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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
function submit(sink, data) { | |
if (!(this instanceof submit)) { | |
return new submit(sink, data) | |
} | |
this.sink = sink | |
this.data = data | |
this.id = sink.id | |
this.type = 'submit' | |
} |
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 h = require('mercury').h; | |
var css = require('./index.css'); | |
var insert = require('insert-css'); | |
module.exports = function component(state) { | |
insert(css); | |
return h('.foo') | |
} |
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 extend = require('xtend'); | |
module.exports = SinkEventHandler; | |
function SinkEventHandler(sink, data) { | |
if (!(this instanceof SinkEventHandler)) { | |
return new SinkEventHandler(sink, data); | |
} | |
this.sink = sink; |
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 mercury = require('mercury'); | |
var h = mercury.h; | |
module.exports = create; | |
module.exports.render = render; | |
function render(state) { | |
return h({}, [ | |
//... |
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
<!-- =============================================== --> | |
<!-- = Quick reference for adding a list of = --> | |
<!-- = articles by month for a section in Mephisto = --> | |
<!-- =============================================== --> | |
<h2>Archive By Month</h2> | |
{% if section.months.size > 0 %} | |
<ul class="archive"> | |
{% for month in section.months %} |
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
# Notes on ActiveRecord methods and idioms | |
# Raises an exception if there is a problem | |
Model.create!(attrs) | |
# Returns true or false (no exceptions are raised) | |
Model.create(attrs) |
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
# Special before filter for adding logging to cucumber, similar to http://bitly.com/pFAxD | |
Before do |scenario| | |
Rails.logger.info "\n\n Scenario(s): #{scenario.to_sexp[3]}\n#{'-' * 78}" | |
end |
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 File.dirname(__FILE__) + '/spec_helper' | |
describe "The library itself" do | |
Spec::Matchers.define :have_no_tab_characters do | |
match do |filename| | |
@failing_lines = [] | |
File.readlines(filename).each_with_index do |line,number| | |
@failing_lines << number + 1 if line =~ /\t/ | |
end | |
@failing_lines.empty? |
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 python | |
import httplib | |
conn = httplib.HTTPConnection("http://ci.wherever.com") | |
conn.request("POST", "/project/builds") | |
# http://ci.example.org/push/TOKEN |
OlderNewer