Skip to content

Instantly share code, notes, and snippets.

View pmarreck's full-sized avatar

Peter Marreck pmarreck

  • formerly desk.com, thredup.com and lifebooker.com. currently Director of Engineering @addigence
  • Long Island, NY
  • 21:33 (UTC -04:00)
View GitHub Profile
@jgaskins
jgaskins / numeric_vs_uuid
Created January 17, 2014 01:38
Comparing numeric vs UUID in Postgres. Rehearsal benchmarks are thrown out. Only the second run is kept. Insertions are done all in one query to minimize the impact of I/O. This is harder to do with retrieval, but the ids are randomized in each one to minimize the effects of caching inside the database.
Inserting
user system total real
Numeric 0.070000 0.010000 0.080000 ( 0.586738)
UUID 0.070000 0.020000 0.090000 ( 3.101085)
Retrieving by id
user system total real
Numeric 0.810000 0.980000 1.790000 ( 6.831551)
UUID 0.830000 0.990000 1.820000 ( 6.981944)
@rxaviers
rxaviers / gist:7360908
Last active April 18, 2024 16:11
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
$ whois microsoft.com
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.
MICROSOFT.COM.ZZZZZZZZZZZZZZZZZZZZZZ.IS.A.GREAT.COMPANY.ITREBAL.COM
MICROSOFT.COM.ZZZZZZZZZZZZZZZZZZZ.GET.ONE.MILLION.DOLLARS.AT.WWW.UNIMUNDI.COM
MICROSOFT.COM.ZZZZZZZZZZZZZZZZZZ.IM.ELITE.WANNABE.TOO.WWW.PLUS613.NET
@mbbx6spp
mbbx6spp / gist:5622645
Last active December 17, 2015 14:09
Add this to your .bash_profile to handle history properly across multiple terminals, and output exit code of last command plus suitable fortune in appropriate color.
declare -r red=$'\e[31;40m'
declare -r blue=$'\e[0;34m'
declare -r d=$'\e[37;40m' # set this to what makes sense for your terminal color scheme
shopt -s histappend
pre_prompt() {
local exit_code=$?;
history -a;
history -n;
@quchen
quchen / trolling_haskell
Last active February 24, 2024 01:30
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now
@havenwood
havenwood / clippy.rb
Last active December 14, 2015 15:08
Send puts output to OS X clipboard inside a block
def clipboard
yield
pbcopy = IO.popen 'pbcopy', 'w'
$stdout = pbcopy
yield
ensure
pbcopy.close
$stdout = STDOUT
end
@ryanb
ryanb / issues_with_modules.md
Created November 29, 2012 22:38
Points on how modules can make code difficult to read.

My issues with Modules

In researching topics for RailsCasts I often read code in Rails and other gems. This is a great exercise to do. Not only will you pick up some coding tips, but it can help you better understand what makes code readable.

A common practice to organize code in gems is to divide it into modules. When this is done extensively I find it becomes very difficult to read. Before I explain further, a quick detour on instance_eval.

You can find instance_eval used in many DSLs: from routes to state machines. Here's an example from Thinking Sphinx.

class Article &lt; ActiveRecord::Base
@domenic
domenic / promises.md
Last active March 31, 2024 14:07
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active March 27, 2024 06:33
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@mbbx6spp
mbbx6spp / GITHUB-COMPARE-LINKS.md
Created June 21, 2012 03:37
This Gist is worth a million beers. So buy me one (or send me a really cool t-shirt, make sure it is REALLY cool though)! :)