Skip to content

Instantly share code, notes, and snippets.

View rubemz's full-sized avatar
🏠
Working from home

Rubem Nakamura rubemz

🏠
Working from home
View GitHub Profile
@alotaiba
alotaiba / google_speech2text.md
Created February 3, 2012 13:20
Google Speech To Text API

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English

@mitfik
mitfik / ruby_csr_example.rb
Created February 27, 2012 10:13
Ruby example of CSR with openssl
require 'openssl'
def gen_key(name)
key = OpenSSL::PKey::RSA.new 1048
file = File.new(name, "w")
file.write(key)
file.close
end
def get_key(name)
@paulnicholson
paulnicholson / powssl
Last active November 24, 2021 16:40
ssl with pow using stud

Instructions

  • Install stud $ brew install https://raw.github.com/paulnicholson/homebrew/master/Library/Formula/stud.rb
  • Download and install the powssl script $ curl https://gist.githubusercontent.com/paulnicholson/2050941/raw/7e4d2178e3733bed18fdfe737277c3cb72241d39/powssl > ~/bin/powssl $ chmod +x ~/bin/powssl
  • Run powssl to create development certificate and configure stud.
  • $ powssl
@steveclarke
steveclarke / capybara.md
Created April 10, 2012 17:32
RSpec Matchers

Capybara

save_and_open_page

Matchers

have_button(locator)
@jboner
jboner / latency.txt
Last active June 9, 2024 15:21
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 9, 2024 10:41
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@weidenfreak
weidenfreak / gist:3987288
Created October 31, 2012 14:21
Timecop and milliseconds
#
# freezing DateTime.now
#
# in Rails
$ rails c
Loading development environment (Rails 3.2.8)
# DateTime and Time have milliseconds before freezing time
>> DateTime.now.iso8601 9
ruby_version="1.9.3-p392"
gem_version="1.8.25"
if [ ! -f /tmp/ruby/bin/ruby ]; then
cd /tmp
rm -f ruby-${ruby_version}.tar.gz
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-${ruby_version}.tar.gz
tar zxvf ruby-${ruby_version}.tar.gz
cd ruby-${ruby_version}
(./configure --prefix=/tmp/ruby && make -j4 && make install) || (echo "Ruby shat the bed" && exit 1)

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

wc -l *.[ch] | grep -v total | sort -rn > /tmp/loc.txt
3696 cluster.c
3560 sentinel.c
3166 redis.c
2219 t_zset.c
1826 replication.c
1819 config.c
1633 redis-cli.c
1557 networking.c