This file contains hidden or 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
# ... | |
gem 'padrino-warden', :git => "git://github.com/zmack/padrino-warden.git" | |
gem 'authtools' |
This file contains hidden or 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
# encoding: utf-8 | |
# Run this with 1.9.2 or 1.9.3 | |
require 'psych' | |
require 'minitest/autorun' | |
require 'date' | |
class ZOMGTest < MiniTest::Unit::TestCase | |
# Quoted strings are assumed to be Strings |
This file contains hidden or 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 Hash | |
def with(&block) | |
block.call *block.parameters.map{|x| self[x.last]} | |
end | |
end | |
# Example | |
h = {:name => "blambeau", :hobby => "ruby"} |
This file contains hidden or 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
# check passenger. | |
$ gem list | grep passenger | |
# if it is missing, install. | |
$ gem install passenger | |
# download new version nginx. | |
$ wget http://nginx.org/download/nginx-1.0.11.tar.gz | |
$ tar -zxf nginx-1.0.11.tar.gz |
This file contains hidden or 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 bash | |
apt-get -y update | |
apt-get -y upgrade | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev libffi-dev libjemalloc-dev | |
apt-get -y install autoconf curl bzip2 | |
apt-get -y autoremove | |
apt-get -y clean | |
cd /usr/local/src | |
curl http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.gz |
This file contains hidden or 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
# How to Install RVM, Ruby, and Gems without Xcode Command Line Tools | |
# =================================================================== | |
# | |
# Mac OS X 10.8.2 (12C60) (Mountain Lion) | |
# Xcode 4.5 (4G182) | |
# | |
# While attempting to `rvm pkg install openssl`, I had encountered the error: | |
# > cryptlib.h:62:20: error: stdlib.h: No such file or directory | |
# But, the commands & ouput below show how I worked around the issue. | |
# |
This file contains hidden or 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 | |
# 2021-12-09: | |
# This script is no longer supported! | |
# Apple broke all direct downloads without logging with an Apple ID first. | |
# The number of hoops that a script would need to jump through to login, | |
# store cookies, and download is prohibitive. | |
# Now we all must manually download and mirror the files for this to work at all :'-( | |
OSX_VERS=$(sw_vers -productVersion | awk -F "." '{print $2}') |
This file contains hidden or 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 'tmpdir' | |
# Usage: | |
# add to ruhoh-site/plugins/publish/github.rb | |
# - Your GitHub remote must be setup properly but The command will try to walk you through it. | |
# - You must have a clean working directory to publish to GitHub pages since the hook is actually triggered by commits. | |
# | |
# $ cd ruhoh-site | |
# $ bundle exec ruhoh publish github | |
class Ruhoh |
This file contains hidden or 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
fn main() { | |
do RoutedServer::serve |config, router| { | |
config.listen("127.0.0.1", 1337); | |
router.get("/hello", |_,res| res.write("hello world")); | |
router.get("/posts/:id", |req,res| { | |
res.write(format!("post {}", req.params["id"])) | |
}); | |
} |
This file contains hidden or 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
#[deriving(Eq)] | |
struct ParamsBuilder { | |
foo: uint, | |
bar: ~str, | |
baz: uint, | |
run: bool | |
} | |
impl ParamsBuilder { |
OlderNewer