This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" .vimrc File | |
" Procured from: Jeffrey Way | |
" [email protected] | |
" | |
" Improved by: Garrett Dawson | |
" [email protected] | |
" | |
"Forget compatibility with Vi. Who cares. | |
set nocompatible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class mm.StoreLocator extends mm.Module | |
constructor: -> | |
@canvas = $('#map-canvas') | |
@center = new google.maps.LatLng(51.512054, -0.103855) | |
@mapOpts = | |
zoom: 11 | |
zoomControl: true #seems that 320-up is breaking zoomcontrol???? though it seems from the mockups that they just want an empy map | |
disableDefaultUI: true | |
mapTypeId: google.maps.MapTypeId.ROADMAP | |
center: @center |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'builder' | |
require 'digest/md5' | |
class Content < ActiveRecord::Base | |
belongs_to :user | |
end | |
class Section < ActiveRecord::Base | |
has_many :assigned_sections | |
has_many :articles, :order => 'position', :through => :assigned_sections |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def resize_and_crop(blob, w0, h0, w1, h1) | |
image = MiniMagick::Image.read(blob) | |
rw = w1.to_f / w0 | |
rh = h1.to_f / h0 | |
unless rw > 1 or rh > 1 | |
w,h = w1, h1 | |
sx, sy = 0, 0 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra/base' | |
require 'eventmachine' | |
require 'logger' | |
$logger = Logger.new(File.join(File.dirname(__FILE__), "development.log")) | |
module TestEM | |
def self.start | |
if defined?(PhusionPassenger) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'em-http-request' | |
require 'fiber' | |
require "ruby-debug" | |
class AsynUploader | |
@successes = [] | |
@failures = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Product < ActiveRecord::Base | |
has_many :material_product_mappings, :dependent => :destroy, :inverse_of => :product | |
has_many :materials, :through => :material_product_mappings, :autosave => true | |
#... | |
rails_admin do | |
list do | |
field :material_product_mappings do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
APP_NAME="your-app-name-goes-here" | |
APP_PATH=/home/deploy/${APP_NAME} | |
# Production environment | |
export RAILS_ENV="production" | |
# This loads RVM into a shell session. Uncomment if you're using RVM system wide. | |
# [[ -s "/usr/local/lib/rvm" ]] && . "/usr/local/lib/rvm" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Copyright (c) 2011 YOUR_NAME_HERE, YOUR_URL_HERE | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# node ---------------> ~/.nvm/<node-version>/bin/node | |
# node-libraries -----> ~/.node_libraries | |
# node-binaries ------> ~/.node_binaries | |
# | |
aptitude install g++ curl libssl-dev apache2-utils make | |
git clone git://github.com/creationix/nvm.git ~/.nvm | |
vi ~/.bashrc | |
NVM_DIR=$HOME/.nvm | |
. $NVM_DIR/nvm.sh |
NewerOlder