Skip to content

Instantly share code, notes, and snippets.

View mattetti's full-sized avatar

Matt Aimonetti mattetti

View GitHub Profile
BEFORE:
sam@ubuntu discourse % rm -fr tmp/cache
sam@ubuntu discourse % rm -fr public/assets
sam@ubuntu discourse % time RAILS_ENV=production bin/rake assets:precompile
58.55s user 1.79s system 100% cpu 1:00.02 total
AFTER:
@gravis
gravis / readme
Created September 26, 2010 17:26
tcp syslog logger for rails draft
tcp_syslog is now a gem :
https://github.com/tech-angels/tcp_syslog
@netj
netj / netj-icon.js
Created October 9, 2010 15:13
my logo icon drawn with Javascript on an HTML5 canvas
// netj's icon with HTML5 canvas
function drawIconOnCanvas(w, opacity, canvas, a) {
if (canvas.getContext) {
var c = canvas.getContext("2d");
// name some constants
canvas.width = canvas.height = w;
c.clearRect(0, 0, w, w);
var o = w/12;
var l = (w-3*o)/2;
@schacon
schacon / classy_git.md
Created November 12, 2010 20:48
RubyConf Talk
$ ./run.rb --rubies=/Library/Frameworks/MacRuby.framework/Versions/0.10/usr/bin/macruby,/Library/Frameworks/MacRuby.framework/Versions/0.11/usr/bin/macruby
Name MacRuby 0.10 MacRuby 0.11
------------------------------------------------------------
array:<< 0.561269 0.576191
array:new 1.911732 2.083757
array:[] 0.135262 0.134868
array:[]= 0.328496 0.329456
eval:lit 0.741252 0.745280
hash:new 4.637268 4.605469
hash:[] 0.565377 0.550961
@mattetti
mattetti / checkboxes.js
Created June 23, 2011 01:28
SC2 form with checkbox behavior
MyApp.Selection = SC.Object.extend({
name: null,
isSelected: false
});
MyApp.content = [
MyApp.Selection.create({ name: "Male" }),
MyApp.Selection.create({ name: "Female" })
]
/**
NOTE: The template in this example relies on itemView, which is not yet
in SproutCore 2.0 master, but is coming
*/
MyApp.Selection = SC.Object.extend({
name: null,
isSelected: false
});
@pvinis
pvinis / face_detector.rb
Created December 7, 2011 12:06
run with "macruby face_detector.rb" or "macruby face_detector.rb https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-snc7/304055_10150415385415891_522505890_10347873_1682210515_n.jpg?dl=1" for a photo of me with woody and buzz lightyear :p
framework 'Cocoa'
class NSColor
def toCGColor
color_RGB = colorUsingColorSpaceName(NSCalibratedRGBColorSpace)
## approach #1
# components = Array.new(4){Pointer.new(:double)}
# color_RGB.getRed(components[0],
# green: components[1],
# blue: components[2],
@mattetti
mattetti / 0-readme.md
Created October 11, 2012 18:23 — forked from burke/0-readme.md

Ruby 1.9.3-p194 with DTrace probes, Perf Patches, and backported COW-friendly GC

Overview

This script installs a patched version of ruby 1.9.3-p194 with DTrace probes, boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Many thanks to funny-falcon for the performance patches and to Aaron Patterson for the DTrace instrumentation.

@teeparham
teeparham / dev.log
Created March 6, 2013 08:05
rails 3.2.12 + ruby 2.0 + bare project + tracepoint
=> Booting WEBrick
=> Rails 3.2.12 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2013-03-06 01:02:27] INFO WEBrick 1.3.1
[2013-03-06 01:02:27] INFO ruby 2.0.0 (2013-02-24) [x86_64-darwin11.4.2]
--- 1
/monkeys/index