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
# 2010-10-01 | |
# | |
# Mac OS X 10.6.3 | |
# Homebrew 0.7 | |
# Xcode 3.2.4 | |
# Git 1.7.3.1 | |
# RVM 1.0.12 | |
# Ruby 1.8.7, 1.9.2 | |
# Passenger 2.2.15 | |
# MySQL 5.1.49 |
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
# Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } | |
require 'rubygems' | |
require 'railsless-deploy' | |
load 'config/deploy' |
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
// main app.js | |
var client = require('ranger').createClient('ROOM', | |
'SECRET'); | |
var timestamp = require('./timestamp').timestamp; | |
var getWeatherWrapper = require('./weather').getWeatherWrapper; | |
var showMap = require('./map').showMap; | |
var getTweets = require('./tweets').getTweets; | |
client.room(ROOMID, function(room) { |
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
curl -v -H 'Accept: application/xml' -F Filedata=@/path/to/file https://trevorturk.basecamphq.com/upload | |
curl -v -H 'Accept: application/xml' -H 'Content-Type: application/xml' -u TOKEN:X \ | |
-d " | |
<post> | |
<title>Test</title> | |
<body>Test</body> | |
<attachments> | |
<file> | |
<file>ID_FROM_FIRST_REQUEST</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
# Update, upgrade and install development tools: | |
apt-get update | |
apt-get -y upgrade | |
apt-get -y install build-essential | |
apt-get -y install git-core | |
# Install rbenv | |
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv | |
# Add rbenv to the path: |
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 'hash' | |
require 'active_resource' | |
require 'basecamp' | |
require 'httparty' | |
require 'json' | |
class GithubIssues | |
include HTTParty | |
base_uri "https://api.github.com" |
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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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 ActionDispatch::Routing::Mapper | |
def draw(routes_name) | |
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
end | |
end | |
BCX::Application.routes.draw do | |
draw :api | |
draw :account | |
draw :session |
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
var user = { | |
validateCredentials: function (username, password) { | |
return ( | |
(!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' } | |
: (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' } | |
: (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' } | |
: (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' } | |
: (!/^([a-z0-9-_]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' } | |
: 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
require 'open-uri' | |
class Story | |
attr_accessor :title, :url | |
def initialize(title, url) | |
@title = title | |
@url = url | |
end | |
OlderNewer