Skip to content

Instantly share code, notes, and snippets.

View jhsu's full-sized avatar
💀
compliant with future standards

Joe Hsu jhsu

💀
compliant with future standards
  • MineHub
  • New York, NY
  • X @jhsu
View GitHub Profile

Introvert

Incoming Call -> twilio app -> voice-to-text -> irc/IM bot notification

User can than respond within a timeout period to answer the call or ignore

irc/IM user response -> text-to-voice -> twilio app -> Caller

#!/bin/bash
# from http://snippets.dzone.com/posts/show/10897
# source this file from bashrc
GOT_AGENT=0
for FILE in $(find /tmp/ssh-???*[0-9]* -type s -user ${LOGNAME} -name "agent.[0-9]*")
do
SOCK_PID=${FILE##*.}

redis @qrush

smart cache, job queues, high speed analytics

binary ops (2.2+)

> touch normal.txt
> stat -f "%Sp" normal.txt
var redis = require('redis');
var client = redis.createClient();
client.set('test', 'hello, world!');
console.log(client.get('test'));
// => undefined
client.get('test', redis.print);
// => Reply: hello, world!
#!/usr/bin/env ruby
require 'fileutils'
require 'colorize'
MUSIC_DIR="/home/jshsu/Media/music/"
songs = Dir.glob("*.mp3").select do |song|
(( Time.now - File.ctime(song) ) / 60 / 60 / 24) >= 1
end
awk 'function wl() {\
rate=64000; \
return (rate/160)*(0.87055^(int(rand()*10)))}; \
BEGIN {\
srand(); \
wla=wl(); \
while(1) {\
wlb=wla; \
wla=wl(); \
if (wla==wlb) \
@jhsu
jhsu / vmigrate.sh
Created February 11, 2011 16:47
edit the most recent rails migration
alias emigrate="$EDITOR db/migrate/$(ls -lp db/migrate | tail -1 | awk '{print $NF}')"
@jhsu
jhsu / bot.rb
Created February 9, 2011 01:13
require 'cinch'
require 'open-uri'
require 'simple-rss'
require 'twitter'
Twitter.configure do |config|
end
class WnyGroup
@jhsu
jhsu / svg
Created January 28, 2011 19:20
#!/usr/bin/env bash
for i in {1..572}; do
curl -O "http://thenounproject.com/site_media/zipped/svg_$i.zip"
done
unzip '*.zip'
a.button, .buttons a, .display_control, .action_list h2
color: white
background-color: #5f76ad
border: 1px solid #447
-webkit-border-radius: 3px
-moz-border-radius: 3px
border-radius: 3px
-webkit-box-shadow: 0 1px 2px #aaa
-moz-box-shadow: 0 1px 2px #aaa
box-shadow: 0 1px 2px #aaa