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 AWS from 'aws-sdk' | |
import Promise from 'bluebird' | |
const env = global.env.env | |
const ddb = new AWS.DynamoDB({ region: 'us-east-1' }) | |
const TableName = global.env.dynamodb.TableName | |
const revisionPrefix = global.env.revisionPrefix | |
const revisionEnv = env === 'development' ? 'beta' : env | |
export default ({ revision = null } = {}) => { |
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 path = require('path'); | |
var FastBootServer = require('./lib/models/server'); | |
var outputPath = 'fastboot-dist'; | |
var appName = 'dummy'; | |
var server = new FastBootServer({ | |
appFile: findAppFile(outputPath, appName), | |
vendorFile: findVendorFile(outputPath), | |
htmlFile: findHTMLFile(outputPath) | |
}); |
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
[alias] | |
st = status | |
ci = commit | |
br = branch | |
co = checkout | |
df = diff | |
lg = log -p | |
[user] | |
name = Tyler Love | |
email = |
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 Base | |
attr_reader :name, :config | |
attr_accessor :operations | |
def initialize(name, opts={}) | |
@name = name | |
@config = opts | |
self.operations = { |
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
# Example of the Dropbox dialect | |
# DropboxCredentials inherits from Pidgin::Credentials::Base | |
# it's basically a store for what each dialect needs specifically to access an API | |
dialect :dropbox, :credentials_class => DropboxCredentials do | |
# Filter invoked as soon as a conversation is initialized with this dialect | |
converse do |credentials| | |
@session = DropboxSession.new(credentials.consumer_token.key, credentials.consumer_token.secret) | |
@session.set_access_token(credentials.access_token.key, credentials.access_token.secret) |
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 '../pidgin/lib/pidgin/dialect' | |
dialect :facebook do | |
# Filter invoked as soon as it's mounted | |
mount do |credentials| | |
end | |
# Filter should return boolean in response to determine | |
# if we really have access |
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
task :test do | |
credentials = DropboxCredentials.new(:access_key => '', :access_secret => '') | |
provider = DropboxProvider.new(:credentials => credentials) | |
mount = DropboxMount.new(:provider => provider) | |
fetcher = DropboxFetcher.new({ | |
:mount => mount, | |
:batch_size => 100, | |
:callbacks => { | |
:on_start => Proc.new { puts 'START' }, | |
:on_load => Proc.new { puts 'LOAD' }, |
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
# A provider must inherit from Pedofile::Provider::Base | |
# A Provider is a source of data (e.g. Dropbox, Twitter, Facebook, Instagram, SugarSync) | |
provider = DropboxProvider.new(:consumer_token => Pedofile::Token.new('xxx', 'xxx'), :access_token => Pedofile::Token.new('xxx', 'xxx')) | |
# A Mount inherits from Pedofile::Mount::Base | |
# A Mount acts as a Controller that massages data from a provider into a uniform format. | |
# mount.entries returns a list of entries | |
# mount.sync! will fetch new entries from a provider | |
mount = DropboxMount.new(:provider => provider) |
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
DV.HSL = function(opts) { | |
var _defaults = { | |
hue: 0.0, | |
sat: 0.0, | |
lum: 0.0, | |
hex: null | |
}; | |
this.config = $.extend(this._defaults, opts); |
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
DV.HSL = function(opts) { | |
var _defaults = { | |
hue: 0.0, | |
sat: 0.0, | |
lum: 0.0 | |
}; | |
this.config = $.extend(this._defaults, opts); | |
this.hue_to_rgb = function(p, q, t) { |
NewerOlder