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
fuzzysearch: (haystack, needle) -> | |
lowHaystack = haystack.toLowerCase() | |
lowNeedle = needle.toLowerCase() | |
i = 0 | |
n = 0 | |
l = undefined | |
while l = lowNeedle[i++] | |
if ((n = lowHaystack.indexOf(l, n)) == -1) | |
return false | |
else |
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'); | |
var Client = require('amazon-api-gateway-client').Client; | |
var RequestLogger = require('stackable-fetcher').RequestLogger; | |
var ResponseLogger = require('stackable-fetcher').ResponseLogger; | |
var client = new Client({ | |
accessKeyId: AWS.config.credentials.accessKeyId, | |
region: 'us-east-1', | |
secretAccessKey: AWS.config.credentials.secretAccessKey, | |
}).use(RequestLogger).use(ResponseLogger); |
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'); | |
var Client = require('amazon-api-gateway-client').Client; | |
var RequestLogger = require('stackable-fetcher').RequestLogger; | |
var ResponseLogger = require('stackable-fetcher').ResponseLogger; | |
var client = new Client({ | |
accessKeyId: AWS.config.credentials.accessKeyId, | |
region: 'us-east-1', | |
secretAccessKey: AWS.config.credentials.secretAccessKey, | |
}).use(RequestLogger).use(ResponseLogger); |
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
{ | |
"json": $input.json('$.*'), | |
"accountId": "$context.identity.accountId", | |
"allParams": "$input.params()", | |
"apiId": "$context.apiId", | |
"apiKey": "$context.identity.apiKey", | |
"caller": "$context.identity.caller", | |
"headerParams": "$input.params().header", | |
"httpMethod": "$context.httpMethod", | |
"pathParams": "$input.params().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
scope :active, -> { not.expired.not.revoked } | |
scope :expired, -> { where('accessed_at < ?', 1.year.ago) } | |
scope :revoked, -> { where.not(revoked_at: nil) } |
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 EventPublisher from '../../shared/libraries/event-publisher' | |
export default class State extends EventPublisher { | |
constructor() { | |
super(); | |
this.selectedSheet = null; | |
this.sheets = []; | |
} | |
addSheet(sheet) { |
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 domainEventPublisher from '../singletons/domain-event-publisher' | |
import EventLogger from '../libraries/event-logger' | |
import ipc from 'ipc' | |
import keyboardEventPublisher from '../singletons/keyboard-event-publisher' | |
import SheetCreator from '../domain-models/sheet-creator' | |
import SheetGroupLoader from '../domain-models/sheet-group-loader' | |
import SheetLoader from '../domain-models/sheet-loader' | |
import SheetMover from '../domain-models/sheet-mover' | |
import SheetUpdater from '../domain-models/sheet-updater' | |
import State from '../domain-models/state' |
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 Cycle, { Rx } from '@cycle/core' | |
import { h, makeDOMDriver } from '@cycle/dom'; | |
const intent = (DOM) => { | |
return {}; | |
}; | |
const model = (actionMap) => { | |
return new Rx.Subject().startWith(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
import { makeDOMDriver } from '@cycle/dom'; | |
import Cycle from '@cycle/core' | |
import intent from './intent' | |
import model from './model' | |
import view from './view' | |
Cycle.run( | |
({ DOM }) => { | |
return { DOM: view(model(intent(DOM))) }; | |
}, |
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 { Rx } from '@cycle/core' | |
import Fetcher from 'stackable-fetcher' | |
export default function makeFetcherDriver(fetcher = new Fetcher()) { | |
return (request$) => { | |
return request$.map((request) => { | |
return Rx.Observable.fromPromise( | |
fetcher[request.method.toLowerCase()]( | |
request.url, | |
request.parameters, |