Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cayblood's full-sized avatar

Carl Youngblood cayblood

View GitHub Profile
@willurd
willurd / web-servers.md
Last active April 23, 2024 04:35
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@jboner
jboner / latency.txt
Last active April 22, 2024 15:20
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
@cayblood
cayblood / backup.conf
Created April 27, 2012 09:49
backing up something daily, weekly, monthly and yearly with logrotate
# daily backup for 7 days
"/file/to/backup.log" {
daily
copytruncate
rotate 7
compress
compresscmd /bin/bzip2
compressext .bz2
}
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@markupboy
markupboy / html5video.sh
Created February 8, 2011 15:43
automated conversion of a file to all three html5 compatible video formats - h.264, ogg, and webm
#!/bin/sh
####################################
# Output file for HTML5 video #
# Requirements: #
# - handbrakecli #
# - ffmpeg #
# - ffmpeg2theora #
# #
# usage: #

Getting started

First add your twitter username and password. Then server.rb and once it's started open websocket.html in your browser. You should see some tweets appear. If not take a look at the javascript console.

@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@whoisjake
whoisjake / gist:174249
Created August 24, 2009 21:54
Basic drop.io Ruby client
require 'rubygems'
# sudo gem install httparty
require 'httparty'
# sudo gem sources -a http://gems.github.com && sudo gem install multipart-post
require 'net/http/post/multipart'
require 'mime/types'
require 'pp'
class Dropio
include HTTParty