Skip to content

Instantly share code, notes, and snippets.

View F1LT3R's full-sized avatar
🌱
Growing Things

Alistair MacDonald F1LT3R

🌱
Growing Things
View GitHub Profile
@F1LT3R
F1LT3R / proxy.js
Created April 28, 2018 04:08 — forked from fracasula/proxy.js
Node.js basic example for proxy to http server
/**
* Once this is running open your browser and hit http://localhost
* You'll see that the request hits the proxy and you get the HTML back
*/
'use strict';
const net = require('net');
const http = require('http');
@F1LT3R
F1LT3R / aws-config.js.env
Last active September 15, 2017 14:26 — forked from ddewaele/simple-cognito-auth.js
AWS Cognito Auth for Node.js
module.exports = {
"AWS": {
"Region": "us-east-1",
"ClientId": "304laiduvj1ld6ls8s2lsjfipa",
"UserPoolId": "us-east-1_aaksjfhTo",
"IdentityPoolId": "us-east-1:018b7af4-9384-8afe-019d-013cc0192d001",
"LoginEndpoint": "cognito-idp.us-east-1.amazonaws.com/us-east-1_aaksjfhTo"
}
}
@F1LT3R
F1LT3R / unicodeEscape.js
Created December 15, 2016 17:16 — forked from mathiasbynens/unicodeEscape.js
Escape all characters in a string using both Unicode and hexadecimal escape sequences
// Ever needed to escape '\n' as '\\n'? This function does that for any character,
// using hex and/or Unicode escape sequences (whichever are shortest).
// Demo: http://mothereff.in/js-escapes
function unicodeEscape(str) {
return str.replace(/[\s\S]/g, function(character) {
var escape = character.charCodeAt().toString(16),
longhand = escape.length > 2;
return '\\' + (longhand ? 'u' : 'x') + ('0000' + escape).slice(longhand ? -4 : -2);
});
}
// ## $.withAdvice
//
// Borrowed by [Flight](https://github.com/flightjs/flight).
//
// `withAdvice` is a mixin that defines `before`, `after` and `around` methods.
//
// These can be used to modify existing functions by adding custom code. All
// components have advice mixed in to their prototype so that mixins can augment
// existing functions without requiring knowledge of the original
// implementation.

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.zshrc
. ~/.zshrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@F1LT3R
F1LT3R / .gitconfig
Last active August 29, 2015 14:11 — forked from alexrinass/.gitconfig
[user]
name = Alexander Rinass
email = alex@rinass.net
[core]
editor = mate -w
[github]
user = alexrinass
[color]
branch = auto
diff = auto

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark