Skip to content

Instantly share code, notes, and snippets.

View benoror's full-sized avatar
🌀
In a quantum state between coding and procrastinating

Ben Orozco benoror

🌀
In a quantum state between coding and procrastinating
View GitHub Profile
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@IanColdwater
IanColdwater / twittermute.txt
Last active August 13, 2026 20:21
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@coffeemug
coffeemug / gist:6168031
Last active June 5, 2026 15:29
The fun of implementing date support
After spending the better part of the month implementing date support
in RethinkDB, Mike Lucy sent the team the following e-mail. It would
have been funny, if it didn't cause thousands of programmers so much
pain. Read it, laugh, and weep!
-----
So, it turns out that we're only going to support dates between the
year 1400 and the year 10000 (inclusive), because that's what boost
supports.
@benoror
benoror / long_query.rb
Created October 5, 2023 16:08
Modularize a long/complex SQL query in Ruby
def my_big_ish_report
my_long_query = ```sql
SELECT a,b,c FROM ... AS q_a
JOIN (
SELECT ... ' Sub-query 1
WHERE client_id = 'foobar'
) sq_1 ON q_a.fkey_id = sq_1.id
INNER JOIN (
SELECT x,y,z FROM ... ' Sub-query 2
JOIN (
@benoror
benoror / Capfile
Created March 3, 2011 03:26
File: benoror@macmini:~/simpleapp/Capfile
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
#For an unknown reason Capistrano can't load Thinking-Sphinx Recipes
#...so commenting out next line
#Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy' # remove this line to skip loading any of the default tasks
@benoror
benoror / deploy.rb
Created March 3, 2011 03:28
File: benoror@macmini:~/simpleapp/config/deploy.rb
default_run_options[:pty] = true
set :user, 'benoror'
set :domain, 'simpleapp.com'
set :application, 'simpleapp'
# the rest should be good
set :repository, "#{user}@#{domain}:#{application}.git"
set :deploy_to, "/home/#{user}/#{domain}"
set :deploy_via, :remote_cache
@benoror
benoror / node-pate-example2
Created January 24, 2015 00:42
node-pate-example2
var pate = require('node-pate');
var formatter = require('./format_lib.js');
var options = {
tpl: '{{ bread/@name }} price: $[[ formatMoney({{ bread/@price }}) ]] ([[ moneyToWords({{ bread/@price }}) ]])',
xml: '<data><row><bread name="Bretzel" price="42.56" /></row></data>',
xpath: '/*/*',
format_lib: formatter
};
@benoror
benoror / node-pate-example.js
Created January 23, 2015 17:36
node-pate example
var pate = require('node-pate');
pate.parse('{{ count/@type }} count: {{ count }}', '<data><row><count type="Bretzel">42</count></row></data>', '/*/*', function (err, data) {
console.log(data);
});
@benoror
benoror / ERP_DBA.md
Last active March 27, 2026 23:12
SQL Database Administrator (DBA)

SQL Database Administrator (DBA)

San Luis Potosi, Mexico

About the Position

Support the development of new generation in-house ERP, by extending data model and enhancing current business processes, while supporting existing users and testing a new technology for rapid prototyping of business applications

Responsibilities

  • Implement and normalize data model via scalable business rules by interacting with both technical and non-technical customers
@benoror
benoror / FE_Dev.md
Last active March 27, 2026 23:12
Front End Developer

Front End Developer

San Luis Potosi, Mexico

About the Position

Front end web developer who loves challenges and is motivated to constantly learn. Passionate about design yet appreciate that for design to be useful, it must serve a need. Acknowledge the tradeoffs of various client-side Javascript frameworks, looking forward to run code through performance analyzers to see where you can improve it, and take just as much time to structure LESS files as Javascript’s.

Responsibilities

  • Test and support existing front end assets