Skip to content

Instantly share code, notes, and snippets.

View davidcelis's full-sized avatar
Verified account

David Celis davidcelis

Verified account
View GitHub Profile
@davidcelis
davidcelis / snowflake-id.sql
Last active November 6, 2022 00:58 — forked from beginor/snowflake-id.sql
Twitter Snowflake ID for PostgreSQL
CREATE SEQUENCE public.snowflake_id_seq;
ALTER SEQUENCE public.snowflake_id_seq OWNER TO postgres;
CREATE OR REPLACE FUNCTION public.snowflake_id()
RETURNS bigint
LANGUAGE 'plpgsql'
AS $BODY$
DECLARE
epoch bigint := 1288834974657;
seq_id bigint;
require 'docker'
container = Docker::Container.create(
'Image' => 'ubuntu:14.04',
'Cmd' => [
'/bin/bash',
'-c',
'for i in {1..10}; do echo $i; sleep 1; done'
]
)
.wizard
- if section == 'new_building'
%a.current
%span.badge.badge-inverse 1
New Building
- else
%a
%span.badge 1
New Building
%a

It's with a heavy heart that I announce that Friday, May 31 2013 will be my last day at Heroku.

How can I possibly put into words what Heroku has meant to me these last six years? I can say it was a tremendous experience; or the opportunity of a lifetime; or the greatest thing I have ever been a part of. I can say that Heroku has been my life's work, as I did recently in a public blog post. All of those things are true, but none seem to capture the enormity of what's transpired these past six years.

I tend to focus on mechanical elements of a company: product, code, design, process. But what has surprised me the most at Heroku is that none of these things is the best part. The best part is the team.

I've never had the chance to work with a more singular group of people. Talented, passionate, skilled, dedicated. Most of all, sharing a set of values: elegance, craft, maniacal focus on simplicity; and an uncompromising belief that the future will be made of software, and how that software gets made will shape

#!/usr/bin/env sh
if ! which md5sum > /dev/null; then
echo Install md5sum
exit 1
fi
if ! which curl > /dev/null; then
echo Install curl
exit 1
@davidcelis
davidcelis / 1.9.3-p362-perf.md
Last active October 17, 2016 11:28 — forked from burke/0-readme.md
Ruby 1.9.3-p362 cumulative performance patch for rbenv

NOTE: THIS PATCH DOES NOT APPLY. Falcon's performance patches have not been updated for p362. See the comments for a fork that uses the Rails Express patch set instead.

ruby-1.9.3-p362 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p362 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

@davidcelis
davidcelis / falcon.patch
Created November 12, 2012 18:03 — forked from funny-falcon/falcon.patch
Performance patch for ruby-1.9.3-head (applies to p194 as well)
diff --git a/array.c b/array.c
index 64647c3..618d9e3 100644
--- a/array.c
+++ b/array.c
@@ -255,15 +255,24 @@ rb_ary_modify(VALUE ary)
rb_ary_modify_check(ary);
if (ARY_SHARED_P(ary)) {
long len = RARRAY_LEN(ary);
+ VALUE shared = ARY_SHARED(ary);
if (len <= RARRAY_EMBED_LEN_MAX) {
@davidcelis
davidcelis / gist:3211214
Created July 30, 2012 22:37 — forked from jimbojsb/gist:1630790
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@davidcelis
davidcelis / lyrics
Created June 29, 2012 22:52 — forked from jhob/lyrics
Adds Rdio and Spotify support
#!/bin/bash
services=(iTunes Rdio Spotify)
for service in "${services[@]}"; do
if ps axco pid,command | grep -v grep | egrep "$service\$" > /dev/null; then
state=`osascript -e "tell application \"$service\" to get player state as string"`
if [ "$state" = "playing" ] ; then
artist_name=`osascript -e"tell application \"$service\" to get artist of current track"`
song_title=`osascript -e"tell application \"$service\" to get name of current track"`
artist=`echo $artist_name | sed "s/[[:space:]]/%20/g"`
@davidcelis
davidcelis / gist:3012391
Created June 28, 2012 16:38 — forked from edhedges/gist:2995805
Sublime Text 2 - Useful Shortcuts (Mac OS X)

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt