Navigation Menu

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 / model_esbuild-0-14-3.js
Created September 1, 2022 22:17
comparison of sequelize model.js as built by esbuild 0.14.3 vs 0.15.6
"use strict";
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
@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)

@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 / 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 / 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 / .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 / 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 / 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 / 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 / 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 =