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 setup() | |
Mongoid.configure do |config| | |
config.master = Mongo::Connection.new.db("testbooks") | |
end | |
@book = Books.create(title: 'Turn of a Screw', author: "Henry James", barcode: '666') | |
end | |
def test_barcode | |
# Test for uniqueness of each book barcode |
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 'httparty' | |
class HTTP | |
include HTTParty | |
def initialize uri | |
self.class.base_uri uri | |
end | |
end | |
class Dropbox < HTTP |
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
<?php | |
/** | |
* Check for post format type, apply filter based on post format name for easy modification. | |
* | |
* @since 1.0 | |
*/ | |
function chimps_post_formats_content() { | |
$format = get_post_format(); | |
$root = get_template_directory_uri(); | |
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
diff --git a/ncurses.rb b/ncurses.rb | |
index 1067083..8cc12bc 100644 | |
--- a/ncurses.rb | |
+++ b/ncurses.rb | |
@@ -23,4 +23,9 @@ class Ncurses < Formula | |
system "make" | |
system "make install" | |
end | |
+ | |
+ def patches |
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
> module Main where | |
First, import all the needed modules. | |
> import Text.Parsec hiding (State) | |
> import Text.Parsec.Indent | |
> import Control.Monad.State | |
Next, define our new Parser type. This replaces the Identity monad | |
with the (State SourcePos) monad. |
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
from fabric.api import env, task, run, sudo, cd, local | |
from fabric.decorators import with_settings | |
from fabric.operations import put | |
env.user = 'ec2-user' | |
env.hosts = [ | |
'ec2-your-address-1.us-west-2.compute.amazonaws.com', | |
'ec2-your-address-2.us-west-2.compute.amazonaws.com', | |
'ec2-your-address-3.us-west-2.compute.amazonaws.com', | |
'ec2-your-address-4.us-west-2.compute.amazonaws.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
/* Solarized Dark | |
For use with Jekyll and Pygments | |
http://ethanschoonover.com/solarized | |
SOLARIZED HEX ROLE | |
--------- -------- ------------------------------------------ | |
base03 #002b36 background | |
base01 #586e75 comments / secondary content |
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
enum Result<S, R, F> { | |
Success(R, ~[S]), | |
Failure(F) | |
} | |
struct Parser<'a, S, R, F> { parse : 'a |&[S]| -> Result<S,R,F> } | |
trait Composable { | |
fn Or(Self, Self) -> Self; | |
} |
OlderNewer