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 ruby | |
require 'thor' | |
class SubCommandBase < Thor | |
def self.banner(command, namespace = nil, subcommand = false) | |
"#{basename} #{subcommand_prefix} #{command.usage}" | |
end | |
def self.subcommand_prefix |
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
import React from 'react'; | |
import md5 from 'MD5'; | |
class Avatar extends React.Component { | |
static propTypes = { | |
email: React.PropTypes.string, | |
size: React.PropTypes.number | |
} | |
static defaultProps = { |
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 'nokogiri' | |
ugly = Nokogiri::HTML ARGF | |
tidy = Nokogiri::XSLT File.open('tidy.xsl') | |
nice = tidy.transform(ugly).to_html | |
puts nice |
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
define(['transit', 'immutable'], function (Transit, Imm) { | |
'use strict'; | |
var reader = Transit.reader('json', { | |
arrayBuilder: { | |
init: function () { return Imm.List.of().asMutable(); }, | |
add: function (ret, val) { return ret.push(val); }, | |
finalize: function (ret) { return ret.asImmutable(); }, | |
fromArray: function (arr) { return Imm.List(arr); } | |
}, |
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 ruby | |
require 'active_support/time' | |
require 'digest' | |
API_KEY = 'YOUR KEY' | |
API_SECRET = 'YOUR SECRET' | |
args = { | |
'from_date' => Date.new(2014,9,1).iso8601, |
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
/** | |
* @jsx React.DOM | |
*/ | |
var React = require('react/addons'); | |
/* the link component is used to navigate away from th current url. Some of it is app spesific and | |
therefore not included here. */ | |
var Link = require('../components/Link.jsx'); | |
var cx = React.addons.classSet; |
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 Authenticated = React.createClass({ | |
statics: { | |
willTransitionTo (transition) { | |
if (!authenticated()) { | |
transition.redirect('login'); | |
} | |
} | |
} | |
}); |
NewerOlder