Skip to content

Instantly share code, notes, and snippets.

source 'http://gemcutter.org'
## Bundle edge rails:
gem "rails", :git => "git://github.com/rails/rails.git"
gem "mysql"
gem "haml", :git => "git://github.com/nex3/haml.git"
gem "compass", "0.10.0.rc2"
gem "show_for", :git => "git://github.com/plataformatec/show_for.git"
/*
A Revised Font Stack
from A Way Back
http://www.awayback.com/revised-font-stack/
*/
/*
@lloydk
lloydk / nginx.conf
Created November 4, 2010 12:19
nginx upstart configuration
sudo update-rc.d -f nginx remove
sudo rm /etc/init.d/nginx
# upstart job commands
sudo start nginx
sudo stop nginx
sudo restart nginx
sudo reload nginx
@lloydk
lloydk / adduser.sh
Created November 6, 2010 22:51
Add a user and group
adduser --system --no-create-home --disabled-login --disabled-password --group <user-group-name>
@lloydk
lloydk / grid.sass
Created April 10, 2011 06:14 — forked from jcroft/grid.sass
// REQUIRED VARS. Defaults to a 950px wide, 24-column grid that has 30px wide units and 10px wide
// gutters. If you do the fluid grid, then this 950/24/30/10px size will become the maximum size.
$grid_type: fixed !default
$grid_columns: 24 !default
$grid_column_width: 30 !default
$grid_gutter_width: 10 !default
// GENERATED VARS. You can ignore these.
$grid_full_width: $grid_columns * $grid_column_width + $grid_columns * $grid_gutter_width - $grid_gutter_width
$grid_column_width_percent: ($grid_column_width / $grid_full_width * 100) * 1%
# vmc update is great for test and development, however it stops your old app and stages and starts the new one,
# resulting in dropped requests.
# If you want to update an application without dropping user requests, see below.
# NOTE: This change assumes your application can share services, etc with the new version.
# Assume my app is named foo
vmc push foo-v2 --url foov2.cloudfoundry.com
require 'rubygems'
require 'json'
require 'redis'
class RedisComments
def initialize(redis,namespace,sort_proc=nil)
@r = redis
@namespace = namespace
@sort_proc = sort_proc
end
@lloydk
lloydk / gist:1019398
Created June 10, 2011 18:16 — forked from dhh/gist:1014971
Use concerns to keep your models manageable
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end
# username = "my_username"
# pwd = "my_password"
target_path = "/Users/pierodibello/Documents/Google Drive/screencasts/RubyTapas"
# saving auth cookie
system %Q{wget --save-cookies /tmp/cookie.txt --keep-session-cookies --post-data "username=#{username}&password=#{pwd}" -O - \
https://rubytapas.dpdcart.com/subscriber/login?__dpd_cart=d08391e6-5fe2-4400-8b27-2dc17b413027}
(25..600).each do |i|
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">