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
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
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 '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
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
" .vimrc File | |
" Procured from: Jeffrey Way | |
" jeffrey@jeffrey-way.com | |
" | |
" Improved by: Garrett Dawson | |
" killtheliterate@gmail.com | |
" | |
"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
require "rubygems" | |
require "bundler/setup" | |
require "stringex" | |
## -- Rsync Deploy config -- ## | |
# Be sure your public key is listed in your server's ~/.ssh/authorized_keys file | |
ssh_user = "user@domain.com" | |
ssh_port = "22" | |
document_root = "~/website.com/" | |
rsync_delete = false |
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
$noise-bg: image-url("{% asset_path images/noise.png %}") top left !default; | |
$img-border: inline-image("{% asset_path images/straight-border.png %}"); | |
// Main Link Colors | |
$link-color: #e11e30 !default; | |
$link-color-hover: adjust-color($link-color, $lightness: 20, $saturation: 45) !default; | |
$link-color-visited: adjust-color($link-color, $hue: 80, $lightness: -4) !default; | |
$link-color-active: adjust-color($link-color-hover, $lightness: -15) !default; | |
// Main Section Colors |
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
# Generating Site with Jekyll | |
WARNING: 'noise.png %}' was not found (or cannot be read) in /Users/yortz/code/projects/website.com/source/_assets/images/{% asset_path images | |
File not found or cannot be read: /Users/yortz/code/projects/website.com/source/_assets/images/{% asset_path images/straight-border.png %} | |
Configuration from /Users/yortz/code/projects/website.com/_config.yml | |
Building site: source -> public | |
Successfully generated site: source -> public |
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
" Screen settings | |
map <F5> :ScreenShellVertical<CR> | |
command! -nargs=? -complete=shellcmd W :w | :call ScreenShellSend("load '".@%."';") | |
map <Leader>c :ScreenShellVertical bundle exec rails c<CR> | |
map <Leader>r :w<CR> :call ScreenShellSend("rspec ".@% . ':' . line('.'))<CR> | |
map <Leader>e :w<CR> :call ScreenShellSend("cucumber --format=pretty ".@% . ':' . line('.'))<CR> | |
map <Leader>b :w<CR> :call ScreenShellSend("break ".@% . ':' . line('.'))<CR> |