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 opts = { endpoint : 'http://dynamodb-local:8000', apiVersion: '2012-08-10' }; | |
var localDynamo new AWS.DynamoDB(opts); | |
vogels.dynamoDriver(localDynamo); |
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 vogels = require('vogels'), | |
Joi = require('joi'); | |
vogels.AWS.config.loadFromPath('./config.json'); | |
var Purchase= vogels.define('Purchase', { | |
hashKey : 'uid', | |
rangeKey: 'tok', | |
// enable timestamps support | |
timestamps : true, |
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
%s/^\(.*\)$/"\1"\,/ |
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
// npm install --save string-hash | |
var stringHash = require('string-hash'); | |
var d = new Date(); | |
var dateStr = d.getFullYear() + '-' + d.getMonth() + '-' + d.getDay() | |
var hashKey = dateStr + ':' + stringHash(account.id) %100; |
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
private func unrotateImage(image : UIImage) -> UIImage { | |
let size = image.size | |
UIGraphicsBeginImageContext(size) | |
image.drawInRect(CGRectMake(0, 0, size.width, size.height)) | |
let newImage = UIGraphicsGetImageFromCurrentImageContext() | |
UIGraphicsEndImageContext() | |
return newImage | |
} |
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 AWS = require('aws-sdk'); | |
exports.handler = function(event, context) { | |
var cloudsearchdomain = new AWS.CloudSearchDomain({endpoint: 'doc-dev-cinch-accounts-ltmqj5gt5mjb5hg5eyqaf2v5hu.us-east-1.cloudsearch.amazonaws.com'}); | |
var documents = event.Records.map(function(record) { | |
var data = {id : record.dynamodb.Keys.id.S}; | |
if (record.eventName === 'REMOVE') { | |
data.type = 'delete' |
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
// | |
// ASTableViewManager.swift | |
// cinch | |
// | |
// Created by Ryan Fitzgerald on 3/9/15. | |
// Copyright (c) 2015 cinch. All rights reserved. | |
// | |
import Foundation | |
import RFSectionDelta |
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
func tableView(tableView: UITableView!, viewForHeaderInSection section: Int, delegate : PollHeaderNodeDelegate?) -> UIView! { | |
var view = tableView.dequeueReusableHeaderFooterViewWithIdentifier("Header") as? UITableViewHeaderFooterView | |
if view == nil { | |
view = UITableViewHeaderFooterView(reuseIdentifier: "Header") | |
} | |
view?.backgroundView = UIImageView() | |
let contentView = view!.contentView |
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
heightForHeaderInSection 0 | |
heightForHeaderInSection 0 | |
heightForHeaderInSection 1 | |
heightForHeaderInSection 1 | |
heightForHeaderInSection 2 | |
heightForHeaderInSection 2 | |
heightForHeaderInSection 3 | |
heightForHeaderInSection 3 | |
heightForHeaderInSection 4 | |
heightForHeaderInSection 4 |
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
func dataSource(dataSource: ASTableViewDataSource, removedSections: NSIndexSet?, insertedSections: NSIndexSet?, movedSections: [MovedIndex]?) { | |
dispatch_async(dispatch_get_main_queue()) { | |
self.tableView.ins_endPullToRefresh() | |
} | |
tableView.beginUpdates() | |
var del = NSMutableIndexSet() | |
var add = NSMutableIndexSet() | |
NewerOlder