Skip to content

Instantly share code, notes, and snippets.

View sirupsen's full-sized avatar
🐡

Simon Eskildsen sirupsen

🐡
View GitHub Profile
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@peternixey
peternixey / securing_rails_updates.md
Created March 5, 2012 13:10
How Homakov hacked GitHub and how to protect your application by Peter Nixey

##How Homakov hacked GitHub and the line of code that could have prevented it


Please note: THIS ARTICLE IS NOT WRITTEN BY THE GITHUB TEAM or in any way associated with them. It's simply hosted as a Gist because the markdown formatting is excellent and far clearer than anything I could manage on my personal Tumblr at peternixey.com.

If you'd like to follow me on twitter my handle is @peternixey


@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

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

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@fennb
fennb / gist:1283573
Created October 13, 2011 06:35
nginx microcaching config example
# Set cache dir
proxy_cache_path /var/cache/nginx levels=1:2
keys_zone=microcache:5m max_size=1000m;
# Virtualhost/server configuration
server {
listen 80;
server_name yourhost.domain.com;
# Define cached location (may not be whole site)
@mrflip
mrflip / RUNME-demo_of_async_fibers.log
Created April 25, 2011 20:57
A fully-commented demo showing execution flow in the fibers+eventmachine => linear asynchronous code pattern
>> load './RUNME-demo_of_async_fibers.rb'
/Users/flip/ics/backend/son_of_a_batch/RUNME-demo_of_async_fibers.rb:4: warning: already initialized constant FIBER_IDXS
814e5e90 0 f_0 beg main top level
814e5e90 1 f_0 beg em setup this block sets up the eventmachine execution, but no execution-order shenanigans yet
814e5e90 2 f_0 beg fiber stp the end-the-reactor block won't be called for 1.5s, so we get here immediately.
814e5e90 3 f_0 end fiber stp nothing from inside the Fiber.new{} block has run yet.
814e5e90 4 f_0 end fiber stp kick off the fiber...
80d829a0 5 f_1 beg fiber when my_fiber.resume is called, this runs. Now in a new fiber
80d829a0 6 f_1 beg get_result get_result is called from within fiber_1
80d829a0 7 f_1 setup callback set up some code to run 1.5s from now

Different services I can suggest when a non-tech friend or family member asks me how they can cheaply make a website and possibly use it to sell stuff online.

Website Hosting

require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
class BuildStatusTest < ActiveSupport::TestCase
test "remove the old statii" do
assert_equal 2, BuildStatus.count
BuildStatus.expire_old
statii = BuildStatus.all
assert_equal 1, statii.size
assert statii[0].updated_at >= 30.days.ago
end
@ryanb
ryanb / favorite_gems.md
Created March 4, 2011 17:31
A list of my favorite gems for various tasks.
@tenderlove
tenderlove / person_test.rb
Created February 10, 2011 23:04
Use minitest/spec with Rails 3
require 'test_helper'
require 'minitest/autorun'
module Tenderlove
class Spec < MiniTest::Spec
include ActiveSupport::Testing::SetupAndTeardown
include ActiveRecord::TestFixtures
alias :method_name :__name__ if defined? :__name__
self.fixture_path = File.join(Rails.root, 'test', 'fixtures')