Skip to content

Instantly share code, notes, and snippets.

View ryantuck's full-sized avatar
🤙
chillin'

Ryan Tuck ryantuck

🤙
chillin'
View GitHub Profile
@ryantuck
ryantuck / xmas
Created November 26, 2014 01:12
rt-notes
# Stuff to do for Listmas app
- add index to present model to return sorted stuff
- test barebones socket.io setup
-
Sensor Ideas for Kegbot
Gesture sensor - https://www.sparkfun.com/products/12787
Force sensitive resistor - https://www.sparkfun.com/products/9375
Humidity/temp sensor - https://www.sparkfun.com/products/8257
Microphone - https://www.sparkfun.com/products/9964
Photocell - https://www.sparkfun.com/products/9088
RFID reader - https://www.sparkfun.com/products/9963
Analog panel meter - https://www.sparkfun.com/products/10286
pH sensor - https://www.sparkfun.com/products/12872
@ryantuck
ryantuck / brew-ruby.md
Created January 21, 2016 16:27
just install ruby.

install ruby when you don't do much ruby but want to download a gem

when gem install trello_cli yields permission errors:

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

you should download another ruby and use that as the default.

from passlib.hash import pbkdf2_sha256
import time
passwd = 'asdf'
for x in range(0,20):
r = pow(2,x)
t0 = time.time()
h = pbkdf2_sha256.encrypt(passwd, rounds=r, salt_size=16)
t1 = time.time()
import arrow
import pprint
start = '2015-01-01'
end = '2015-01-02'
s = arrow.get(start)
e = arrow.get(end)
print s
import pandas as pd
data = [
[1,2],
[3,4],
[5,6]
]
cols = ['a','b']
def fn(*args, **kwargs):
print kwargs
print '{a} {b}'.format(**kwargs)
fn(a='blah', b='asdf')
import pandas as pd
data = [
[1,2],
[3,4],
[4,5],
[8,9]
]
df = pd.DataFrame(data, columns=['a','b'])

how to be leet with your keyboard remappings

0. install seil and karabiner.

1. change esc to shift + cmd in ~/Library/Application Support/Karabiner/private.xml:

<?xml version="1.0"?>
<root>
@ryantuck
ryantuck / ansible-localhost.md
Last active April 3, 2024 15:21
super fast way to start testing ansible stuff locally without VMs

set up ansible to work on localhost

i've found this useful for debugging ansible modules and syntax without having to use VMs or test in dev environments.

install ansible

pip install ansible

make some relevant config files