This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install qpdf | |
# first decrypt | |
find . -name '*.pdf' | xargs basename | xargs -L1 -I {} qpdf --decrypt --password=PASSWORD {} dec{} | |
# then merge | |
qpdf --empty --pages dec*.pdf -- all.pdf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# source | |
https://www.facebook.com/notes/%D7%93%D7%96%D7%90%D6%B7%D7%A0%D7%90%D6%B7%D7%98%D7%94%D7%A2%D7%9F-%D7%9E%D7%99%D7%99/aachen-style-local-history-or-never-forget-what-you-did-ever-again/10152290882464430 | |
This comes from Carmen Heger and Sasa Hasan, by way of Aachen, where Arne Mauser was the apparent originator. Please feel free to share this but cite them (not me, unless you want to cite this specific note). If you want to skip to the instructions they're at the bottom. | |
The idea is a .history file is created in every directory you work in with the list of all the commands you typed (except for a few that match a list of boring stuff like ls). | |
This is if you want to save yourself the trouble of cut-and-pasting into a README in each directory. I still do that, actually, but this functions as a readme of last resort. It's also great for seeing what steps others have done if you're trying to debug their inability to reproduce your results. | |
example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# download imagesnap [http://iharder.sourceforge.net/current/macosx/imagesnap/] | |
# identify your video recording device | |
./imagesnap -l | |
# repeatedly take a snapshot | |
while :; do ./imagesnap -d "HD Pro Webcam C920" ~/Pictures/snapshots/`date +%H-%M-%S`.jpeg; sleep 58; done | |
# optional: resize | |
# WARNING - will overrite your files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RD_DIR=~/projects/evme/rd | |
alias rd='cd $RD_DIR' | |
alias rdenv='rd && source rd-env/bin/activate' | |
alias rdshell='rdenv && cd rd/rd_service && ipython -i $RD_DIR/shell.py' | |
alias rdpostgres='postgres -D /usr/local/var/postgres' | |
alias rdworker='rdenv && cd rd/rd_service && python cli.py worker' | |
alias rdclearjobs='redis-cli del jobs' | |
alias rdweb='cd $RD_DIR/rd && honcho start -f Procfile.dev' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install command line tools | |
# running 'make' will trigger the installation (a confirmation will open) | |
make | |
# git should be installed now | |
git | |
# setup git | |
git config --global user.name "John Doe" | |
git config --global user.email johndoe@example.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.indexOf = function(query, start) { | |
var streak = 0; | |
start = Math.min(start || 0, this.length - 1); | |
// TODO stop at this.length - query.length | |
for (var i = start; i < this.length; i++) { | |
if (this[i] === query[streak]) | |
streak++; | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
now = new Date() | |
// Sat Nov 02 2013 08:56:45 GMT+0200 (IST) | |
start = new Date() | |
start.setMonth(start.getMonth()-1) | |
start | |
// Wed Oct 02 2013 08:57:26 GMT+0300 (IDT) | |
end = new Date() | |
end.setDate(end.getDate()-1) | |
// Fri Nov 01 2013 08:57:30 GMT+0200 (IST) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd gaia | |
npm install | |
export GAIATEST_ACKNOWLEDGED_RISKS=true | |
export GAIATEST_SKIP_WARNING=true | |
./node_modules/.bin/travisaction gaia_ui_tests install | |
# run all tests | |
./node_modules/.bin/travisaction gaia_ui_tests script | |
# or just one |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# checkout a branch by partial name | |
go = "!sh -c \"if [ $(git branch | grep $1 | wc -l) -gt 1 ]; then git branch | grep $1; else git checkout $(git branch | grep $1); fi\"" | |
# open conflicted files in editor | |
revise = !sh -c \"git diff --name-only | uniq | xargs subl\" |