Skip to content

Instantly share code, notes, and snippets.

@torgeir
torgeir / aws-stream-logs-from-cloudwatch-lambda-es--lambda-code.js
Created August 4, 2016 12:18
AWS stream logs from "cloudwatch -> lambda -> es" node.js lambda-code
// v1.1.2
var https = require('https');
var zlib = require('zlib');
var crypto = require('crypto');
var endpoint = '<aws es endpoint>';
exports.handler = function(input, context) {
// decode input from base64
var zippedInput = new Buffer(input.awslogs.data, 'base64');
@ivangonekrazy
ivangonekrazy / Ivan-MDErgo1.json
Created February 10, 2016 22:45
Example Ergodox Infinity Keyboard layout (includes mappings for the FLASH command on both halves)
{
"header": {
"Author": "HaaTa (Jacob Alexander) 2015",
"Base": "Blank",
"Date": "2015-09-12",
"Generator": "KIICONF 0.2",
"KLL": "0.3c",
"Layout": "Default",
"Name": "MDErgo1",
"Version": "0.1"
@rootscity
rootscity / gist:fcf909f5820407a67c8e
Created February 7, 2016 05:24
angular-material modal drag directive
// Usage
//
//<md-dialog rc-drag="md-toolbar" ng-cloak>
// <form>
// <md-toolbar>
// ...
// </md-toolbar>
// <md-dialog-content>
// ...
// </md-dialog-content>
@addyosmani
addyosmani / 12-days.js
Last active February 3, 2016 18:31
12 Days of Christmas in ES2015 - paste this into your DevTools console!
// adapted from https://tonicdev.com/n3dst4/twelve-days-of-emoji
// full credit to n3dst4. I just rewrote this to be browser developer tools friendly.
const pressies = [
"🐦🍐🌳",
"🐢🐦",
"🇫🇷🐔",
"📞🐦",
"💛💍",
"🐦🍳 ",
"🐦🏊",
@vladikoff
vladikoff / doskey.md
Last active March 11, 2024 17:27
Setup Persistent Aliases & Macros in Windows Command Prompt (cmd.exe) using DOSKey

Setup Persistent Aliases & Macros in Windows Command Prompt (cmd.exe) using DOSKey

Saved from Archive.org, Date: May 14, 2010 Author: Jesse Webb

http://web.archive.org/web/20140330024520/http://devblog.point2.com/2010/05/14/setup-persistent-aliases-macros-in-windows-command-prompt-cmd-exe-using-doskey/

Our development machines here at Point2 are not standardized; we have a mixture of Windows XP, 7, and Mac OSX/Unix computers. I find myself constantly switching back and forth between command prompt interfaces when pair programming. As a result, I catch myself using “ls” to list a directories contents regardless of what system I am on. I am currently using a Windows XP machine for my developer box and I wanted to setup an alias to the “ls” command to actually perform a “dir”. Here is how I accomplished it…

There is a command available in a Window’s shell that let’s you “alias” command to whatever you please: DOSKey. It allows you to create “macros” to execute one or more other commands with a custom nam

@chrisrzhou
chrisrzhou / README.md
Last active October 19, 2017 09:32
D3 Sunburst Sequence

D3 Sunburst Sequence

bl.ocks.org link

D3 Sunburst Sequence visualizes a graph of nodes by highlighting sequential progression of nodes leading up to a final value. A sunburst sequence is useful to visualize relative weights/percentages of a starting state to an end state (e.g. webpage redirects, product retention, subscription-based products, cashflows).


Description

@philippschmitt
philippschmitt / countPhotosForGeoLocation
Last active May 13, 2020 22:02
Count all photos that are available on Flickr and Panoramio for a specific geo fence
/*
This script counts all photos that are available on Flickr and Panoramio for a specific geo fence and returns a JSON object with the data.
For convenience it's embedded in a little node.js server so that you can upload it to your server and use it as an API.
Here's an example url with all query attributes prefilled. Please use your own Flickr API key!
The location is the Berlin TV Tower (http://en.wikipedia.org/wiki/Fernsehturm_Berlin)
Example URL: http://piccounter-philippschmitt.rhcloud.com/?lat=52.520732&lon=13.409537&latRes=0.00015&lonRes=0.0003&flickrKey=60d03369d3e92b4578c8f2df2de5af66
@guilu
guilu / windows terminal - Solarized Dark.reg
Created August 21, 2014 07:06
windows terminal Solarized Dark
Windows Registry Editor Version 5.00
; Registry file that maps the solarized palette to the 16 avaliable colors
; in a Windows command prompt. Note, hex values in the table are RGB but byte
; ordering of a DWORD is BGR, e.g. "ColorTable<##>"=dword:00<B><G><R>
;
; Solarized color table from http://ethanschoonover.com/solarized.
;
; NR cmd.exe PowerShell SOLARIZED HEX DWORD
; -- ------- ----------- --------- ------- --------
(function () {
var apply = Function.prototype.apply;
var flatten = apply.bind(Array.prototype.concat, []);
Array.prototype.selectMany = function (fn) {
return flatten(this.map(fn));
};
}());
// usage