Blog post here: http://developer.uservoice.com/entries/how-to-upgrade-a-rails-2.3.14-app-to-ruby-1.9.3/
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 | |
# use with 'fswatch . ./compressandupload.sh' | |
# https://github.com/alandipert/fswatch | |
# moves compressed files to a sub dir called "handbraked", which you need to create first | |
echo "---------- starting" | |
OUTPUTDIR="/your/path/here" | |
FILES=* | |
for f in $FILES |
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/sh | |
# upstart-job | |
# | |
# Symlink target for initscripts that have been converted to Upstart. | |
set -e | |
APP_PATH="/srv/rails/seek" | |
APP_NAME="Seek" | |
APP_USER="www-data" | |
NUM_WORKERS="1" |
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
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide | |
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel | |
mkdir ~/ffmpeg_sources | |
cd ~/ffmpeg_sources | |
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz | |
tar xzvf yasm-1.2.0.tar.gz | |
cd yasm-1.2.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
source 'https://rubygems.org' | |
gem 'sinatra' | |
gem 'json' | |
gem 'omniauth' | |
gem 'omniauth-oauth2' | |
gem 'omniauth-github' | |
gem 'omniauth-facebook' | |
gem 'omniauth-twitter' | |
# gem 'omniauth-att', :path => File.expand_path("./../../omniauth-att", __FILE__) |
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
// based on and inspired by https://gist.github.com/1026439 and https://gist.github.com/3798781 | |
// | |
// MIT license. Use however you'd like. | |
// | |
// first, define our macro for delaying our transition: | |
#define PKWaitDelay(dly, block) dispatch_after(dispatch_time(DISPATCH_TIME_NOW,dly*100000),dispatch_get_main_queue(), ^{ block }) | |
// then, inside your AppDelegate.m in didFinishLaunchingWithOptions: | |
UIImageView *imageView = [[UIImageView alloc] initWithFrame:self.window.frame]; |
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
# NAME: authinabox | |
# VERSION: 1.01 (Dec 27, 2008) | |
# AUTHOR: Peter Cooper [ http://www.rubyinside.com/ github:peterc twitter:peterc ] | |
# DESCRIPTION: An "all in one" Sinatra library containing a User model and authentication | |
# system for both session-based logins OR HTTP Basic auth (for APIs, etc). | |
# This is an "all in one" system so you will probably need to heavily tailor | |
# it to your own ideas, but it will work "out of the box" as-is. | |
# COMPATIBILITY: - Tested on 0.3.2 AND the latest rtomayko Hoboken build! (recommended for the latter though) | |
# - NEEDS DataMapper! | |
# - Less work needed if you use initializer library -- http://gist.github.com/40238 |
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
# port of http://www.perlmonks.org/?node_id=162190 | |
# | |
# Please refactor this if necessary | |
# leonb -at- beriedata -dot- nl | |
# | |
class String | |
def yoda | |
word = %w{is be will show do try are teach have look help see can learn has}.select { |word| self =~ /\b#{word}\b/ }[0] | |
if word | |
x = (self =~ /\b#{word}\b/) + word.size |