This file contains 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 uninstall tmux | |
brew install https://raw.github.com/adamv/homebrew-alt/master/other/tmux-iterm2.rb | |
tmux -S /tmp/pair -C new -s session_name | |
chmod 777 /tmp/pair | |
tmux -S /tmp/pair -C attach -t session_name |
This file contains 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
<?xml version="1.0"?> | |
<root> | |
<deviceproductdef> | |
<productname>APPLE_INTERNAL_KEYBOARD_TRACKPAD_0x024c</productname> | |
<productid>0x024c</productid> | |
</deviceproductdef> | |
<deviceproductdef> | |
<productname>APPLE_WIRELESS_KEYBOARD_0x22c</productname> | |
<productid>0x22c</productid> | |
</deviceproductdef> |
This file contains 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
class BigDecimalWithoutTrailingZeroes < BigDecimal | |
def to_digits | |
_, significant_digits, _, exponent = split | |
if zero? | |
'0' | |
elsif exponent >= significant_digits.size | |
to_i.to_s | |
else | |
to_s('F') | |
end |
This file contains 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
alias loc-files='git ls-files **/*.(rb|ru|coffee|scss|handlebars) script bin' | |
alias loc='loc-files | xargs cat | ruby -ne '\''print unless $_ =~ /^\s*#|^\s*$/'\'' | wc -l' |
This file contains 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
pond = {salmon:1, crucian:3, carp:4, herring:6, sturgeon:8, gudgeon:10, minnow:50} | |
pond.map { |_, weight| 0.01 ** (1.0 / weight) } | |
# Fractional exponents are the same as a radical, so | |
# crucian is the cube-root of 0.01, carp is the 4th-root of 0.01... | |
# https://www.desmos.com/calculator/zjgygztibi | |
pond.map { |_, weight| 0.99 ** (1.0 / weight) } | |
# crucian is the cube-root of 0.99, carp is the 4th-root of 0.99... |
This file contains 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
pkill -f god | |
pkill -f sidekiq | |
sudo service boocx-app-web stop | |
sudo service boocx-api stop | |
cd /home/boocx | |
cd boocx-api | |
git pull | |
bundle | |
git submodule update --init |
This file contains 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
count = 25 | |
name = "main" | |
starting = 0 | |
ending = starting + count | |
key = "queue:#{name}" | |
total_size = 0 | |
keep = {} | |
loop do |
This file contains 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
->(klass){ names = klass.all.map(&:name); names.detect {|e| names.count(e) > 1 } }.call Tag | |
# Up arrow and change to Amenity, Usage, etc. ^ |
This file contains 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
The original: | |
Father-Daughter Talk | |
A young woman was about to finish her first year of college. Like so many others her age, she considered herself to be a very liberal Democrat, and was very much in favor of the redistribution of wealth. She was deeply ashamed that her father was a rather staunch Republican, a feeling she openly expressed. Based on the lectures that she had participated in, and the occasional chat with a professor, she felt that her father had for years harbored an evil, selfish desire to keep what he thought should be his. | |
One day she was challenging her father on his opposition to higher taxes on the rich and the addition of more government welfare programs. The self-professed objectivity proclaimed by her professors had to be the truth and she indicated so to her father. He responded by asking how she was doing in school. Taken aback, she answered rather haughtily that she had a 4.0 GPA, and let him know that it was tough to maintain, insisting that she was taking a very difficult cours |
This file contains 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
ssh-copy-id pi@192.168.X.X | |
# on the pi | |
sudo su - | |
cat <<EOF >> /etc/wpa_supplicant/wpa_supplicant.conf | |
network={ | |
ssid="Your SSID Here" | |
proto=RSN | |
key_mgmt=WPA-PSK | |
pairwise=CCMP |