Skip to content

Instantly share code, notes, and snippets.

View rbq's full-sized avatar

rbq

  • Germany, NRW
View GitHub Profile
@nathos
nathos / twitterbutton.sass
Last active September 26, 2015 18:17
Scalable twitter button
.twitterbutton
// change size to any (reasonable) percentage/px you want
// font-size: 200%
color: #4e839e
font-family: "Helvetica Neue", Arial, sans-serif
font-weight: 300
line-height: 1em
text-decoration: none !important
text-rendering: optimizeLegibility
padding: 0.5em 0.7em
@mislav
mislav / Gemfile
Created August 31, 2011 21:48
How to integrate Compass with Rails 3.1 asset pipeline
group :assets do
gem 'sass-rails', '~> 3.1.0'
gem 'coffee-rails', '~> 3.1.0'
gem 'uglifier'
gem 'compass'
end
$ rvm install jruby && rvm --create jruby@torquebox && jruby -J-Xmx1024m -S gem install torquebox-server --pre && torquebox
jruby-1.6.5 - #fetching
jruby-1.6.5 - #downloading jruby-bin-1.6.5, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 14.6M 100 14.6M 0 0 1868k 0 0:00:08 0:00:08 --:--:-- 2189k
jruby-1.6.5 - #extracting jruby-bin-1.6.5 to /Users/jim/.rvm/src/jruby-1.6.5
jruby-1.6.5 - #extracted to /Users/jim/.rvm/src/jruby-1.6.5
Building Nailgun
jruby-1.6.5 - #installing to /Users/jim/.rvm/rubies/jruby-1.6.5
@noeticpenguin
noeticpenguin / mr_status_bar_app.rb
Created December 15, 2011 12:13 — forked from rubiojr/mr_status_bar_app.rb
MacRuby StatusBar Application
#
# Initialize the stuff
#
# We build the status bar item menu
def setupMenu
menu = NSMenu.new
menu.initWithTitle 'FooApp'
mi = NSMenuItem.new
mi.title = 'Hellow from MacRuby!'
mi.action = 'sayHello:'
@mbleigh
mbleigh / Gemfile
Created March 21, 2012 03:14
Non-Rails Rackup with Sprockets, Compass, Handlebars, Coffeescript, and Twitter Bootstrap
source "https://rubygems.org"
gem 'sprockets'
gem 'sprockets-sass'
gem 'sass'
gem 'compass'
gem 'bootstrap-sass'
gem 'handlebars_assets'
gem 'coffee-script'
@onecrayon
onecrayon / Postbox.plist
Created July 6, 2012 15:10
Postbox-style keybindings for MailMate (save in ~/Library/Application Support/MailMate/Resources/KeyBindings)
{
// Keybindings to emulate Postbox defaults in MailMate
// From: http://www.postbox-inc.com/support/postbox_shortcuts
// Created by Ian Beck <http://beckism.com>
"f" = "nextMessage:";
"b" = "previousMessage:";
"n" = "nextUnreadMessage:";
"p" = "previousUnreadMessage:";
"T" = "nextUnreadThread:";
@KieranP
KieranP / orphaned_check.rake
Last active October 11, 2015 11:08
Rake task that scans all Rails models for orphaned belong_to associations (Rails 3.2 or higher)
task :orphaned_check => :environment do
Dir[Rails.root.join('app/models/*.rb').to_s].each do |filename|
klass = File.basename(filename, '.rb').camelize.constantize
next unless klass.ancestors.include?(ActiveRecord::Base)
orphanes = Hash.new
klass.reflect_on_all_associations(:belongs_to).each do |belongs_to|
assoc_name, field_name = belongs_to.name.to_s, belongs_to.foreign_key.to_s
@lukego
lukego / pbook in sed
Created October 24, 2012 13:10
Format program listings for Markdown
sed -E -e 's/^/ /g' -e 's/^ --- ?//g' | pandoc -o listing.pdf -
That expression is a cheap literate programming system for Markdown.
Start commentary lines with '--- ' and they will be
markdown-formatted, the rest will be code. (Uses Lua comment syntax.)
Finally the right implementation of this idea:
http://fresh.homeunix.net/~luke/misc/emacs/pbook.pdf (program)
http://fresh.homeunix.net/~luke/misc/erlang/regtest.pdf (better example)
@ashedryden
ashedryden / gist:3969567
Created October 28, 2012 19:22
Ashe's hair dyeing proces

I, personally, have a salon bleach any hair that I am going to be dyeing over. They know what they're doing more than me so I won't have broken, damaged hair and bleaching it means that the color will be much more bright and last longer.

Prep

I have just a small section of hair to dye (right now it's just the front part of my hair, but I will be bleaching + dyeing the underside next month), I am able to do all of this myself.

You will need:

@woodie
woodie / README.rdoc
Created January 3, 2010 23:32
Rails 2.3.5 on App Engine with DataMapper

Rails 2.3.5 on App Engine (DataMapper)

Do not use rvm (or install and run from JRuby). The google-appengine gem must install into your system MRI. The appengine-sdk gem includes a complete Java app server. We bootstrap Java from MRI, then your app runs inside a servlet container (with access to all the APIs) using the version of JRuby installed into each app.

We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.x calls to rubygems, and now we have it working. Rails 2.3.x currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

See the TInyDS version also: gist.github.com/gists/269075

Install the Development Environment