Skip to content

Instantly share code, notes, and snippets.

View schmod's full-sized avatar
🌈
now in color

Andrew Schmadel schmod

🌈
now in color
View GitHub Profile
@schmod
schmod / ExternalInterfaceExample.swf
Created November 2, 2012 21:35
SWFObject ExternalInterface Test
@schmod
schmod / tm2pyg.json
Created March 7, 2013 00:06
TextMate/Sublime => Pygments scope/token equivalents A work in progress
global =
{
background: 'background_color',
foreground: '',
invisibles: '',
lineHighlight: 'highlight_color',
selection: ''
}
styles =
@schmod
schmod / winpty.gyp
Created August 8, 2013 14:10
winpty.gyp modifications to fix build process. You may need the Windows SDK installed.
{
'targets' : [
{
'target_name' : 'winpty-agent',
'type' : 'executable',
'include_dirs' : [
'include',
],
'defines' : [
'UNICODE',
@schmod
schmod / crimea.csv
Last active December 24, 2015 11:59 — forked from mbostock/.block
date wounds other disease
5/1854 0 95 105
6/1854 0 40 95
7/1854 0 140 520
8/1854 20 150 800
9/1854 220 230 740
10/1854 305 310 600
11/1854 480 290 820
12/1854 295 310 1100
1/1855 230 460 1440
@schmod
schmod / Gruntfile.js
Last active December 28, 2015 08:19
grunt-modernizr 0.4.0
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
modernizr: {
'devFile': 'remote',
'outputFile': 'modernizr.js',
'extra': {
},
@schmod
schmod / .babelrc
Last active February 10, 2016 15:55
Babel Block Scoping Transform -- Scope Bindings are not renamed
{
"plugins": ["babel-plugin-transform-es2015-block-scoping", "./plugin"]
}
@schmod
schmod / test.js
Last active April 27, 2016 16:17
Webpack 2 vs Webpack 1 comparison
import angular from 'angular';
import moment from 'moment';
export default angular.module('foo', [])
.run(function(){
window.foo = moment();
});
@schmod
schmod / rollup-cjs.js
Last active August 22, 2016 13:52
rollup vs webpack
This file has been truncated, but you can view the full file.
var myMod = (function () {
'use strict';
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}
function interopDefault(ex) {
return ex && typeof ex === 'object' && 'default' in ex ? ex['default'] : ex;
}
function createCommonjsModule(fn, module) {
@schmod
schmod / process.js
Created August 1, 2017 18:20
Reprocessing stuck AWS Lambda Redshift batches
/*
This is a quick-and-dirty script to reprocess files that have been partially-processed by aws-lambda-redshift-loader,
if an error has left entries in your LambdaRedshiftProcessedFiles DynamoDB table that don't have corresponding entries
in the LambdaRedshiftBatches table (and therefore cannot be easily reprocessed by any of the tools bundled with
aws-lambda-redshift-loader).
You'll need to enter a few configuration details about your AWS account and S3 bucket, and run query.js to generate
a list of S3 keys that you'd like to retry.
@schmod
schmod / README.md
Last active December 2, 2020 06:04
elasticsearch.js, Bluebird, and AWS Elasticsearch with TypeScript

A quick example demonstrating how to use elasticsearch.js, Bluebird, and AWS Elasticsearch with TypeScript.

You'll need to install a few dependencies and types:

npm install --save @types/elasticsearch @types/http-aws-es elasticsearch http-aws-es bluebird

If you're using AWS Elasticsearch, provide an ES_TYPE environment variable set to aws, as well as values for AWS_ACCESS_KEY, AWS_SECRET_KEY, and AWS_REGION. (I make this configurable so it's easy to point applications at a local ES instance when developing/testing locally, and at AWS when deployed to production)