gpg --gen-key
gpg --list-secret-keys --keyid-format LONG
gpg --armor --export <sec-key>
Add to github setting.
git commit -S ...
function git-revert-batch { | |
echo "$@" | xargs -n1 git revert --no-commit | |
} | |
alias grb='git-revert-batch' | |
# use like: | |
# grb ee5c95a 981da8b | |
# list commits in reverse order, and it's ready to make one neat+tidy revert-commit |
#!/bin/bash | |
# Unload the keyboard so I can use my external keyboard | |
# and not worry about accidentally pressing buttons on | |
# the built-in. This may not be a problem for you but, you | |
# should see my desk sometimes (Oh no!!) ;-) | |
sudo kextunload /System/Library/Extensions/AppleUSBTopCase.kext/Contents/PlugIns/AppleUSBTCKeyboard.kext/ | |
# enableIt |
#!/bin/sh | |
COURSIER_URL=https://raw.githubusercontent.com/alexarchambault/coursier/v1.0.0-M12/coursier | |
test -e ./.coursier/cr || (mkdir -p ./.coursier && curl -s --output ./.coursier/cr $COURSIER_URL && chmod +x ./.coursier/cr) | |
CLASSPATH="$(./.coursier/cr fetch -q -p \ | |
\ | |
com.chuusai:shapeless_2.11:2.3.1 \ | |
com.lihaoyi:ammonite-repl_2.11.8:0.5.8 \ | |
\ | |
)" java ammonite.repl.Main --predef 'import shapeless._' |
gpg --gen-key
gpg --list-secret-keys --keyid-format LONG
gpg --armor --export <sec-key>
Add to github setting.
git commit -S ...
import scala.concurrent.duration._ | |
import scala.concurrent.ExecutionContext | |
import scala.concurrent.Future | |
import akka.pattern.after | |
import akka.actor.Scheduler | |
/** | |
* Given an operation that produces a T, returns a Future containing the result of T, unless an exception is thrown, | |
* in which case the operation will be retried after _delay_ time, if there are more possible retries, which is configured through | |
* the _retries_ parameter. If the operation does not succeed and there is no retries left, the resulting Future will contain the last failure. |
An exploration of the different render methods available in react-enzyme.
# Find out the connections of a process | |
lsof -i -a -p <PID> | |
# Find out the route table | |
netstat -nr | |
netstat -A inet -p | grep <pattern of process> | |
# Find out the ip of a domain name | |
nslookup <domain name> |
wget -O jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 | |
chmod +x ./jq | |
cp jq /usr/bin |
================== | |
# CentOS-Base.repo | |
# | |
# The mirror system uses the connecting IP address of the client and the | |
# update status of each mirror to pick mirrors that are updated to and | |
# geographically close to the client. You should use this for CentOS updates | |
# unless you are manually picking other mirrors. | |
# | |
# If the mirrorlist= does not work for you, as a fall back you can try the | |
# remarked out baseurl= line instead. |
C-x c b
C-c $
then select save word
C-c C-x \