Skip to content

Instantly share code, notes, and snippets.

View DAddYE's full-sized avatar

Davide D'Agostino DAddYE

  • Uber
  • San Francisco
View GitHub Profile
@txus
txus / specs.watchr
Created October 5, 2010 12:24
specs.watchr
# adapted from http://github.com/rspec/rspec-rails/blob/master/specs.watchr
# Run me with:
#
# $ watchr specs.watchr
# --------------------------------------------------
# Convenience Methods
# --------------------------------------------------
def all_spec_files
@maccman
maccman / widget.rb
Created October 19, 2010 09:48
MacRuby Webkit Interface
framework "WebKit"
class Widget
class RPC
class << self
public :include
end
def initialize(widget)
@widget = widget
@mikhailov
mikhailov / installation.sh
Created November 23, 2010 15:18
nginx+passenger (real production config)
# NOTICE: to get Nginx+Unicorn best-practices configuration see the gist https://gist.github.com/3052776
$ cd /usr/src
$ wget http://nginx.org/download/nginx-1.2.1.tar.gz
$ tar xzvf ./nginx-1.2.1.tar.gz && rm -f ./nginx-1.2.1.tar.gz
$ wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.30.tar.gz
$ tar xzvf pcre-8.30.tar.gz && rm -f ./pcre-8.30.tar.gz
$ wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
@quackingduck
quackingduck / app.rb
Created February 12, 2011 10:55
A one-file MacRuby app
#!/usr/bin/env macruby
framework 'AppKit'
# Inspired by: http://cocoawithlove.com/2010/09/minimalist-cocoa-programming.html
# Inits NSApp
NSApplication.sharedApplication
# Allows an app without an applicaiton bundle or info.plist to still be an app
@nesquena
nesquena / killmatch
Created April 6, 2011 02:52
Kills all processes matching a pattern (killmatch)
# !/usr/bin/env ruby
# USAGE
# sudo killmatch Rails
unless ARGV[0]
puts "Specify a pattern to kill! i.e killmatch Rails"
exit
end
@bernerdschaefer
bernerdschaefer / gist:962715
Created May 9, 2011 15:19
some bash helpers for working with padrino projects
alias rake="time rake"
# Run `padrino rake` when inside a padrino project,
# otherwise run the normal rake command.
function rake () {
if [[ -f ".components" ]]; then
padrino rake $*
else
ruby -S rake $*
fi
" Search for mkdCode and throw this in there where you like...I did on line 72
syn region mkdCode start=/^``[^`]*/ end=/[^`]*``.*/
@b0c1
b0c1 / gist:1037593
Created June 21, 2011 10:41
Padrino multi role monkey patch
#put into the padrino boot.rb file before Padrino.load!
module Padrino
module Admin
module AccessControl
class Base
##
# Return an array of project_modules
#
def project_modules(account)
roles = account.roles if account.roles.kind_of?(Array) rescue []
@nesquena
nesquena / upgrade.md
Created July 28, 2011 05:43
Upgrade to Lion
require 'sinatra/base'
require 'ostruct'
dummy = OpenStruct.new :template_cache => Tilt::Cache.new, :settings => Sinatra::Base
dummy.extend Sinatra::Templates
puts dummy.markdown('# hi')