Skip to content

Instantly share code, notes, and snippets.

View carlosmarin's full-sized avatar
🎯
Focusing

Carlos Marin carlosmarin

🎯
Focusing
View GitHub Profile
@timc3
timc3 / gist:2259914
Created March 31, 2012 06:18
Sublime text ipdb trace
<snippet>
<content><![CDATA[
import ipdb; ipdb.set_trace()
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>ipdb</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.python</scope>
</snippet>
@jboner
jboner / latency.txt
Last active June 23, 2025 16:42
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
@noibl
noibl / hn-betteridge.user.js
Created June 11, 2012 04:55
Betteridge's Law for Hacker News
// ==UserScript==
// @name BetteridgeLinks
// @description Lowlight headlines on Hacker News that conform to Betteridge's Law
// @version 0.3
// @match http://news.ycombinator.com/*
// @author noibl <[email protected]>
// ==/UserScript==
var questions = ['Is', 'Are', 'Does', 'Do', 'Has', 'Have', 'Did', 'Will', 'Can', 'Could', 'Should'];
var selector = '.title a';
@ggreer
ggreer / gist:3106202
Created July 13, 2012 17:40
Rackspace auth 500
ggreer@carbon:~/code% curl -v -H 'Content-type: application/json' -H 'Content-type: text/plain' -d '{"auth": {"passwordCredentials": {"username": "reachnovadevops", "password": "NOPE"}}}' https://auth.api.rackspacecloud.com:443/v2.0/tokens
* About to connect() to auth.api.rackspacecloud.com port 443 (#0)
* Trying 67.192.1.11... connected
* Connected to auth.api.rackspacecloud.com (67.192.1.11) port 443 (#0)
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
30013:PRIMARY> db.setProfilingLevel(2);
{ "was" : 0, "slowms" : 20, "ok" : 1 }
30013:PRIMARY> db.t.drop();
true
30013:PRIMARY> x={a:1}
{ "a" : 1 }
30013:PRIMARY> db.t.insert(x);
30013:PRIMARY> db.t.find();
{ "_id" : ObjectId("508a12d8ae35c0f1400789e1"), "a" : 1 }
30013:PRIMARY> db.system.profile.find({"ns":"test.t"});
@dmytro
dmytro / ssh-multi.sh
Created October 31, 2012 03:46
Start multiple synchronized SSH connections with Tmux
#!/bin/bash
# ssh-multi
# D.Kovalov
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
# a script to ssh multiple servers over multiple tmux panes
starttmux() {
if [ -z "$HOSTS" ]; then
@gmcerveny
gmcerveny / geekdom_meditation.md
Last active October 13, 2015 08:38
Geekdom Meditation

Geekdom Meditation

The purpose of this group is to spend time sitting in silence with the company of others. Sittings are 20 minutes long.

Join

Every Thursday, 7:30 am

Location: Geekdom, 11th floor, Licklidder Room

@aponxi
aponxi / sql-mongo_comparison.md
Last active December 12, 2024 01:11
MongoDb Cheat Sheets

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.

@treyhunner
treyhunner / problem.py
Created February 20, 2013 22:24
Programming interview practice of the week (Feb. 20, 2013)
"""
Programming interview practice of the week (2013-02-20)
Problem of the week - Singletons considered okay
1. Write a simple singleton class in your favorite programming language with an example usage.
2. Solve the Sorted array binary search problem:
Given a sorted array of integers array and an integer key, return the index of the first instance of key in the array. If key is not present in array, you should return -1.