Skip to content

Instantly share code, notes, and snippets.

@shripadk
shripadk / gist:552554
Created August 27, 2010 00:59
Setting up Heroku Hostname SSL with GoDaddy SSL Cert
How to setup Heroku Hostname SSL with GoDaddy SSL Certificate and Zerigo DNS
Heroku recently added an exciting new 'Hostname SSL' option. This option offers the broad compatibility of IP-based SSL, but at 1/5 the price ($20 / month at the time of this writing).
The following tutorial explains how to use Heroku's new 'Hostname SSL' option on your Heroku project. Before we begin, let's list what we're using here:
* Heroku Hostname SSL
* GoDaddy Standard SSL Certificate
* Zerigo DNS
@thulstrup
thulstrup / compass-retina-sprites.scss
Created March 20, 2012 19:18
Using Compass to generate normal and retina sprite maps
$sprites: sprite-map("sprites/*.png");
$sprites-retina: sprite-map("sprites-retina/*.png");
@mixin sprite-background($name) {
background-image: sprite-url($sprites);
background-position: sprite-position($sprites, $name);
background-repeat: no-repeat;
display: block;
height: image-height(sprite-file($sprites, $name));
width: image-width(sprite-file($sprites, $name));
@jordelver
jordelver / gist:3230399
Created August 1, 2012 20:25
Ruby simple delegator
# Example from http://mikepackdev.com/blog_posts/31-exhibit-vs-presenter
class Decorator < SimpleDelegator
end
class Car
def price
1_000_000
end
end
require "timeout"
module WaitSteps
extend RSpec::Matchers::DSL
matcher :become_true do
match do |block|
begin
Timeout.timeout(Capybara.default_wait_time) do
sleep(0.1) until value = block.call
@jordelver
jordelver / gist:4755252
Last active December 12, 2015 09:58
Tests and code under test in the same file

Tests and code under test in the same file

The test will only run when run interactively (i.e. ruby ).

class Word
  def length
    10
  end
end
@jordelver
jordelver / gist:5063615
Created March 1, 2013 09:51
Make the Sign Column show up all the time
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Add a 'dummy' sign to the Sign Column to make it show up all the time
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
function! ShowSignColumn()
sign define dummy
execute 'sign place 9999 line=1 name=dummy buffer=' . bufnr('')
endfunc
"" Make the Sign Column always show up
au BufRead,BufNewFile * call ShowSignColumn()
@roxlu
roxlu / install_arch_linux.org
Created March 5, 2013 22:42
Install arch-linux - work in progress gui

Installing ARCH linux

Preparation:

  • Get an empty USB disk
  • Create 2 partitions:
    • ARCH - filesystem FAT
    • FAT - filesystem FAT
  • Downlaod Arch linux from: www.archlinux.org/download and put on your USB ARCH partition
  • Make sure you have an Ubuntu install somewhere (VMware would work)

Fix the iso to be usable for UEFI:

@jsteiner
jsteiner / projections.json
Last active June 14, 2016 17:38
Example Rails.vim projections for a Backbone.js project.
{
"app/assets/javascripts/models/*.coffee": {
"command": "jmodel",
"alternate": "spec/javascripts/models/%s_spec.coffee",
"template": "class @AppName.Models.%S extends Backbone.Model"
},
"app/assets/javascripts/collections/*.coffee": {
"command": "jcollection",
class Foo
def bar(arg)
arg.call
end
end
class X
def call
"Normal class"
end
@xaviershay
xaviershay / build_frontend.sh
Last active December 24, 2015 20:49
SASS + Coffee + Concatenation in prod
#!/bin/bash
set -exo pipefail
BUILD_ENV=$1
if [ `uname` == 'Darwin' ]; then
OSX=1
JSCOMPRESSOR="yuicompressor --type js"
else
OSX=