ckujau / scripts Goto Github PK
View Code? Open in Web Editor NEWMiscellaneous scripts, braindumps, snippets.
Miscellaneous scripts, braindumps, snippets.
diff2html.patch
--- /old/diff2html.sh 2020-02-06 15:56:17.000000000 -0700
+++ /new/diff2html.sh 2020-02-06 15:24:27.000000000 -0700
@@ -118,7 +118,7 @@
done
IFS=$OIFS
-if [ $diffseen -eq 0 && $onlyseen -eq 0 ]; then
+if [[ $diffseen -eq 0 && $onlyseen -eq 0 ]]; then
printf '</span>'
else
echo "</div>"
Currently we store the basename (the filename w/o the pathname) to the xattr as well, and I wonder why I did this. Let this issue sit here until I've thought this over and made up my mind.
The current format is, e.g. for Linux:
setfattr --name user.checksum."$DIGEST" --value "`$PROGRAM "$BASENAME"`" "$BASENAME"
Why don't we just do:
setfattr --name user.checksum."$DIGEST" --value "`$PROGRAM "$FILENAME" | cut -c-64`" "$FILENAME"
This way we may be able to omit the use of BASENAME altogether. But maybe there was a point in storing the basename in the first place?
Background: because the filename is stored with the xattr, once we rename the filename, the "check" operation will still pass, but the "get" operation will show the old filename. We could implement a "update-filename" operation or something like this, but we could also drop the filename from the xattr altogether, no?
$ date > foo
$ checksum_file.sh set foo
Setting user.checksum.sha256 on foo...
$ checksum_file.sh check foo
FILE: foo - OK
$ mv foo bar
$ checksum_file.sh check bar
FILE: bar - OK
$ checksum_file.sh check-set bar
INFO: checksum found for bar, not setting a new checksum.
$ checksum_file.sh get bar
user.checksum.sha256="a2b7681fcbd961f79e1ba6b66cdd9cb50289ff2692ccb1dbe978546febd5d2cb foo"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.