As configured in my dotfiles.
start new:
tmux
start new with session name:
require 'rubygems' | |
require 'yaml' | |
# A demonstration of YAML anchors, references and handling of nested values | |
# For more info, see: | |
# http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/ | |
stooges = YAML::load( File.read('stooges.yml') ) | |
# => { | |
# "default" => { |
As configured in my dotfiles.
start new:
tmux
start new with session name:
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
#A Collection of NLP notes
##N-grams
###Calculating unigram probabilities:
P( wi ) = count ( wi ) ) / count ( total number of words )
In english..
struct OBJECT{ // The object to be serialized / deserialized | |
public: | |
// Members are serialized / deserialized in the order they are declared. Can use bitpacking as well. | |
DATATYPE member1; | |
DATATYPE member2; | |
DATATYPE member3; | |
DATATYPE member4; | |
}; | |
void write(const std::string& file_name, OBJECT& data) // Writes the given OBJECT data to the given file name. |
/* | |
* I add this to html files generated with pandoc. | |
*/ | |
html { | |
font-size: 100%; | |
overflow-y: scroll; | |
-webkit-text-size-adjust: 100%; | |
-ms-text-size-adjust: 100%; | |
} |
ssh() { | |
if [ "$(ps -p $(ps -p $$ -o ppid=) -o comm=)" = "tmux" ]; then | |
tmux rename-window "$(echo $* | cut -d . -f 1)" | |
command ssh "$@" | |
tmux set-window-option automatic-rename "on" 1>/dev/null | |
else | |
command ssh "$@" | |
fi | |
} |
#!/bin/bash | |
# seeding adopted from https://stackoverflow.com/a/41962458/7820599 | |
get_seeded_random() | |
{ | |
seed="$1"; | |
openssl enc -aes-256-ctr -pass pass:"$seed" -nosalt \ | |
</dev/zero 2>/dev/null; | |
} |