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
// Note: This takes your data keys and drops them directly into the | |
// UpdateExpression. If you have more exotic key names, this will likely | |
// fail because 'this is a valid key name' works in javascript but not the | |
// dynamodb client. | |
var keyName = 'thePartitionKey'; | |
var data = { | |
thePartitionKey: '1231342142321321', | |
message: 'your partial data i.e. the fields you want updated in the target document' | |
}; |
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
<body> | |
<script> | |
// our data returned from server | |
var myMockEventObject = { | |
id: 'trkevt_1', | |
created: '', | |
updataed: '', | |
}; | |
// pretend data returned from server |
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
module.exports.handle = function(event, context, callback) { | |
callback(null, 'hello world!'); | |
}; |
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
let nodeDeps = {}; | |
let nodeCache = {}; | |
// some dependency | |
Object.defineProperty(nodeDeps, 'some_module', { | |
get: () => { | |
if (process.argv[2] !== 'hello') throw new Error('hello must be first argument'); | |
const nodeModule = nodeCache.some_module || { world: () => console.log('world') }; | |
return nodeModule; | |
} |
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 strict'; | |
const path = require('path'); | |
const rollup = require('rollup'); | |
const babel = require('rollup-plugin-babel'); | |
const nodeResolve = require('rollup-plugin-node-resolve'); | |
const commonjs = require('rollup-plugin-commonjs'); | |
const builtins = require('rollup-plugin-node-builtins'); | |
const globals = require('rollup-plugin-node-globals'); |
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 strict'; | |
var assert = require('assert'); | |
var AWS = require('aws-sdk'); | |
var dynogels = require('dynogels'); | |
var Enjoi = require('enjoi'); | |
var config = { | |
endpoint: 'http://localhost:8000', | |
}; |
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
if (ENV === 'development') { | |
var m_route_set = m.route.set; | |
var lastCall = new Date().getTime(); | |
var minDelayBetweenCalls = 100; | |
m.route.set = function() { | |
var args = arguments; | |
var now = new Date().getTime(); | |
var elapsed = now - lastCall; | |
lastCall = now; | |
setTimeout(function() { |
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 strict'; | |
var MockBrowser = require('mock-browser').mocks.MockBrowser; | |
var jsdom = require('jsdom'); | |
function propagateToGlobal (window) { | |
for (var key in window) { | |
if (!window.hasOwnProperty(key)) continue | |
if (global[key]) { |
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
// Deps on jquery | |
(function(container) { | |
var viewportWidth = $(container).width(); | |
console.group('Overflow Check'); | |
console.info('Container Width: %s', viewportWidth); | |
$('*').each(function() { | |
var $this = $(this); | |
var elWidth = $this.outerWidth(true); | |
if (elWidth > viewportWidth) { | |
console.warn('Overflow by %spx!', elWidth - viewportWidth, loggingVars, this); |
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
@echo off | |
REM You may need to add `cd %WORKSPACE%` in the jenkins project prior to | |
REM calling this script. I have it in mine and didn't test without. | |
REM Correct paths to respective applications as-needed | |
SET PATH=%PATH%;C:\Program Files (x86)\nodejs;C:\Program Files (x86)\Git\bin;%AppData%\npm;C:\Ruby200-x64\bin | |
echo Installing or updating bower... |