Skip to content

Instantly share code, notes, and snippets.

View whalesalad's full-sized avatar
🐟
i've seen more spine in jellyfish

Michael Whalen whalesalad

🐟
i've seen more spine in jellyfish
View GitHub Profile
@bontoJR
bontoJR / notify.rb
Created December 12, 2012 20:46
Basic APN server built on top of Sinatra
# notify.rb
require 'sinatra/base'
require 'sinatra/json'
require 'grocer'
class App
attr_accessor :bundleID, :pusher_dev, :pusher_prod
end
@klange
klange / _.md
Last active December 2, 2023 20:36
It's a résumé, as a readable and compilable C source file. Since Hacker News got here, this has been updated to be most of my actual résumé. This isn't a serious document, just a concept to annoy people who talk about recruiting and the formats they accept résumés in. It's also relatively representative of my coding style.

Since this is on Hacker News and reddit...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is a good bit crazier.
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • Since people kept complaining, I've fixed the assignments of string literals to non-const char *s.
  • My use of type * name, however, is entirely intentional.
  • If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at le
@stephenlauck
stephenlauck / joyent-smartos-base64-1.8.1.erb
Created October 4, 2012 22:08
Joyent SmartOS Base64 1.8.1 Knife Bootstrap
# Joyent SmartOS Base64 1.8.1
# shove this in ~/.chef/bootstrap/joyent-smartos.erb
# run knife bootstrap <hostname> -d joyent-smartos
bash -c '
if [ ! -f /opt/local/bin/chef-client ]; then
pkgin -f update
pkgin -y install gcc47 gcc47-runtime scmgit-base scmgit-docs gmake ruby193-base ruby193-yajl ruby193-nokogiri ruby193-readline emacs-nox11 pkg-config
gem update --system
gem install --no-ri --no-rdoc ohai
@idStar
idStar / UWFacebookService.m
Created August 30, 2012 16:47
Facebook Utility class to determine if logged in or not
#import "UWFacebookService.h"
@implementation UWFacebookService
// Static
static const int ddLogLevel = LOG_LEVEL_DEBUG;
// Strong
@synthesize facebookGraphUser = _facebookGraphUser;
@mrrooijen
mrrooijen / README.md
Last active February 11, 2023 19:44
Setting up XEN on a Hetzner Dedicated Server

Setting up XEN on a Hetzner Dedicated Server

Author: Michael van Rooijen (@mrrooijen)

DISCLAIMER: I am a programmer, not a sysadmin in my day-to-day life. I provide this guide simply as a self-reference, and as a way to contribute to the community of developers. The main motivation for writing this guide is because of the lack of properly written guides/tutorials. They were either out-dated, inaccurate, in a non-English language or simply too vague to understand (at least for me, as a programmer and not a sysadmin).

I hope this guide helps getting you up and running with your own collection of VPS's on your own Dedicated Server over at Hetzner.de.

Requirements:

@troy
troy / oneline_detailed_logging.rb
Created August 10, 2012 02:13
One-line detailed logging for Rails 3 (ActiveSupport::Notifications) and later
# Outputs this at warn log level:
# 1.2.3.4 GET /path 200 OK BlahController#action HTML 938.2 (DB 11.8, View 719.7) {params} {optional params from flash[:log]}
#
# Save as config/initializers/oneline_detailed_logging.rb. Consider
# decreasing the log level from "info" to "warn" (in production.rb) so
# the one-line log message replaces the standard request logs.
# override process_action to add 2 things to the payload:
# - remote IP
@walkermatt
walkermatt / debounce.py
Created June 4, 2012 21:44
A debounce function decorator in Python similar to the one in underscore.js, tested with 2.7
from threading import Timer
def debounce(wait):
""" Decorator that will postpone a functions
execution until after wait seconds
have elapsed since the last time it was invoked. """
def decorator(fn):
def debounced(*args, **kwargs):
def call_it():
@flaneur2020
flaneur2020 / Gemfile
Created February 8, 2012 02:27
less painful web prototyping with sinatra, slim, sass, and coffeescript
source 'http://ruby.taobao.org'
gem 'sinatra'
gem 'sinatra-reloader'
gem 'slim'
gem 'sass'
gem 'coffee-script'
gem 'compass'
gem 'pry'
@karmi
karmi / ElasticSearch.org.Website.Search.FieldNotes.markdown
Created April 8, 2011 17:15
Field notes gathered during installing and configuring ElasticSearch for http://elasticsearch.org

ElasticSearch.org Website Search: Field Notes

These are field notes gathered during installation of website search facility for the ElasticSearch website.

You may re-use it to put a similar system in place.

The following assumes:

@zefer
zefer / copy-s3-bucket.rb
Created April 4, 2011 11:24
Copy contents of an S3 bucket to a another bucket using an EC2 instance and a simple Ruby script. Useful for transferring large amounts of data and will work across geographic regions.
require 'rubygems'
require 'right_aws'
aws_access_key_id = 'your-access-key'
aws_secret_access_key = 'your-secret-key'
target_bucket = 'your-source-bucket'
destination_bucket = 'your-destination-bucket'
s3 = RightAws::S3Interface.new(aws_access_key_id, aws_secret_access_key)