Skip to content

Instantly share code, notes, and snippets.

View Sutto's full-sized avatar

Darcy Laycock Sutto

View GitHub Profile
@staltz
staltz / introrx.md
Last active April 25, 2024 04:18
The introduction to Reactive Programming you've been missing
@swrobel
swrobel / 1-OpsWorksPapertrail.md
Last active August 5, 2021 20:41
Send OpsWorks log files to Papertrail using the remote_syslog gem
  1. Add remote_syslog to your Gemfile
  2. Add papertrail.rake to lib/tasks
  3. Add remote_syslog.yml to config/
  4. Add before_restart.rb to deploy/
  5. Set the PAPERTRAIL_PORT ENV var to the one provided by Papertrail for your system

Inspiration from Scott W. Bradley

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@mislav
mislav / easy_way.rb
Last active May 20, 2020 13:48
RESOLVE SHORT URLS before storing. Short URLs are for microblogging; you should never actually keep them around.
require 'net/http'
# WARNING do not use this; it works but is very limited
def resolve url
res = Net::HTTP.get_response URI(url)
if res.code == '301' then res['location']
else url.to_s
end
end
@sj26
sj26 / enumerator_thread_pooling.rb
Last active January 27, 2017 03:42
Process an enumerator using a simple thread pool
require "etc"
require "thread"
Enumerator.class_eval do
# Process an enumerator using a simple thread pool
#
# `of:` is pool size, defaults to detecting number of CPUs
#
# Caveat: Enumerator#map may yield results out of order. Work is processed in
# order, but apparently #map concatenates the results however it likes. This
@ianloic
ianloic / desktopsearch.m
Created September 16, 2011 00:46
Tell the Rdio desktop app to search
/* Build this with:
* gcc desktopsearch.m -o desktopsearch -ObjC -framework Cocoa
*/
#include <Cocoa/Cocoa.h>
int main(int argc, char** argv) {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if (argc == 2) {
@brianmario
brianmario / config.ru.rb
Created April 21, 2011 06:11
minimal rails3 app
# minimal rails3 app
require 'action_controller'
Router = ActionDispatch::Routing::RouteSet.new
Router.draw do
root :to => 'site#index'
end
class SiteController < ActionController::Metal
@chriseppstein
chriseppstein / compass.rb
Created January 18, 2011 05:56
The compass configuration file at caring.com
if ENV['RAILS_ENV'] && !defined?(RAILS_ENV)
Object.const_set("RAILS_ENV", ENV['RAILS_ENV'])
end
# Require any additional compass plugins here.
require 'grid-coordinates'
require 'compass-fancybox-plugin'
require 'susy'
project_type = :rails