Skip to content

Instantly share code, notes, and snippets.

View diverted247's full-sized avatar

Ted Patrick diverted247

View GitHub Profile
@diverted247
diverted247 / 1.md
Last active August 29, 2015 14:23
AWS:EB NodeJS "node_modules" Deployment Issues

We started noticing slower deployment times when we switched to GIT deployment on Amazon Elastic Beanstalk. The core issue turned out to be how nodejs module dependencies are packaged. When git is used it is typical to ignore the node_modules directory and thus 'npm install' will install them server side during a deployment. The problem is that 'npm install' has a hard dependency on git so you must have all of the following installed on all instances for deployment to work correctly:

  • git
  • openssl
  • expat
  • gettext
  • zlib

#Tests We tested the following 2 builds, one with node_modules bundled and one where it was installed server side via 'npm install'.

@diverted247
diverted247 / compress.py
Created April 21, 2015 14:47
Walking paths, delete all .gz files, the compress all files to .gz
import os
import gzip
def process( directory ):
for dirpath , dnames , fnames in os.walk( directory ):
for f in fnames:
if f.endswith( '.gz' ):
print( 'Delete:' + f )
os.remove( dirpath + os.sep + f )
@diverted247
diverted247 / 0 README
Last active August 29, 2015 14:19
Recurly Callback API Server in Hapi.js
The Recurly Webhook api calls a remote server passing data about user events. This server captures the calls and account_code to enable updating remote data. Typically you would use the Recurly REST API to validate any webhook call from the API itself.
SETUP
$ npm install
$ node server.js
$ source text.sh # posts data.xml to local server simulating webhook callbacks
@diverted247
diverted247 / 0 README
Last active August 29, 2015 14:19
TypeScript 1.5.0-alpha Decorators
mkdir testDecorators
mkdir testDecorators
npm init
npm install [email protected] --save
node_modules/typescript/bin/tsc decorate.ts
node decorate.js
false -> true
true -> false
@diverted247
diverted247 / external.svg
Created April 1, 2015 03:47
Loading external SVG via <use> element. Make note of id in root of external svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@diverted247
diverted247 / 0_raw.svg
Created March 30, 2015 03:06
Raw, SVGO, Flatten
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@diverted247
diverted247 / README
Last active November 14, 2024 22:01
Export slides from Google Slides as SVG - Console Script (Chrome tested)
To export SVG from Google Slides.
1. Open Slide deck.
2. View -> 100%
3. Click on every thumbnail from first to last, this puts the SVG into the DOM.
4. Paste the export.js in the console.
5. Make sure to allow multiple downloads.
6. All SVG should be in Downloads folder.
Cheers,
@diverted247
diverted247 / gist:cf8d2bb1d5eff47dd7c0
Created March 26, 2015 14:47
Circle path yeilding errors
M 52.4 104.048956523861 C 81.3397207253334 104.048956523861 104.8 80.7568137917513 104.8 52.0245 C 104.8 23.2921862082486 81.3397207253334 0.00004347613943 52.4 0.00004347613943 C 23.4602792746667 0.00004347613943 8.88178419700125e-15 23.2921862082486 8.88178419700125e-15 52.0245 C 8.88178419700125e-15 80.7568137917513 23.4602792746667 104.048956523861 52.4 104.048956523861 Z
@diverted247
diverted247 / gist:d04eb3bc375b9ab145c3
Created January 8, 2015 16:40
rotateOnCenter using Matrix2D logic from 0.7.1
// Rotates a DisplayObject on center by angleInDegrees
private rotateOnCenter( component:createjs.DisplayObject , x:number , y:number , angleInDegrees:number ):void {
// Make a new Matrix
var m = new createjs.Matrix2D( 1 , 0 , 0 , 1 , 0 , 0 );
// Transform midpoint into matrix space
var point = new createjs.Point( 0 , 0 );
point = m.transformPoint( x , y , point );
// Translate matrix by point to center component on matrix
m.tx -= point.x;
m.ty -= point.y;
@diverted247
diverted247 / gist:eefa5acf75897d6dcc23
Created November 8, 2014 16:09
Fonts in txt release
amaticsc.txt
arimo.txt
cantarell.txt
cinzel.txt
comfortaa.txt
craftygirls.txt
dancingscript.txt
droidsans.txt
fredokaone.txt
glegoo.txt