Skip to content

Instantly share code, notes, and snippets.

View diverted247's full-sized avatar

Ted Patrick diverted247

View GitHub Profile
@diverted247
diverted247 / 0 source.ts
Last active October 30, 2015 20:26
ts.ModuleKind.*
import {f} from "foo"
export var x = f()
@diverted247
diverted247 / Sample.go
Created September 15, 2015 20:22
Dynamic model assignment from Struct in Go
type Check struct {
StyleId string `json:"styleId" binding:"required"`
ProductCode string `json:"productCode" binding:"required"`
Overlay bool `json:"overlay"`
Font string `json:"font"`
OwnerText []string `json:"ownerText" binding:"required"`
BankText []string `json:"bankText" binding:"required"`
NumberingRouting string `json:"numberingRouting" binding:"required"`
NumberingAccount string `json:"numberingAccount" binding:"required"`
@diverted247
diverted247 / package.json
Last active September 9, 2015 16:56
Simple Hapijs Server
{
"name": "simple_hapi",
"version": "1.0.0",
"description": "Use Hapi as a general purpose localhost web server",
"main": "server.js",
"author": "Ted Patrick <[email protected]> (http://tedpatrick.com/)",
"license": "BSD",
"dependencies": {
"hapi": "9.3.1"
}
var gulp = require( 'gulp' );
var ts = require( 'gulp-tsc' );
var connect = require( 'gulp-connect' );
var shell = require( 'gulp-shell' );
var uglify = require( 'gulp-uglify' );
var concat = require( 'gulp-concat' );
var del = require( 'del' );
gulp.task( 'clean' , function( cb ){
del([ './dist' ], cb );
@diverted247
diverted247 / TimecodeFilter.js
Created August 27, 2015 18:58
Timecode Filter in Vuejs... Pass seconds as number returns formatted minutes and seconds
Vue.filter( 'timecode' , function( value ){
var seconds = Math.floor( value % 60 ).toString();
var minutes = Math.floor( value / 60 ).toString();
if( seconds.length === 1 ){
seconds = '0' + seconds;
}
return minutes + ':' + seconds;
});
@diverted247
diverted247 / Edit.svg.txt
Last active August 29, 2015 14:26
SVG Edit to remove clipPath
<g transform="translate(6858 23241) scale(.817)">
<image width="980" height="458" preserveAspectRatio="none" transform="matrix(334.417 0 0 334.417 6823.5 18138.387)" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="../images/3.png"/>
</g>
@diverted247
diverted247 / encode.sh
Created July 9, 2015 14:38
Basic encoding of .wav to .aac, .m4a, .mp3, .ogg, .opus in bash
avconv -i 003.wav -c libfaac -b 128k 003.aac
avconv -i 003.wav -c libfaac -b 128k 003.m4a
avconv -i 003.wav -b 128k 003.mp3
oggenc 003.wav
opusenc 003.wav 003.opus
@diverted247
diverted247 / gist:b5e1a95bcfdc34981c3b
Last active August 29, 2015 14:24
install FFMPEG with libs
brew install ffmpeg --with-faac --with-fdk-aac --with-libvorbis --with-opus --with-libquvi
@diverted247
diverted247 / gist:64e0387b403e56bd452b
Created June 24, 2015 16:05
Nested type definition syntax
config?: {
handler: any;
bind: any;
app: any;
plugins: {
[name: string]: any;
};
pre: Array<() => void>;
validate: {
headers: any;
@diverted247
diverted247 / gist:be5381f3f0df3afa5f6b
Created June 17, 2015 02:44
New Child Event Syntax - Allows you to put a click event on ever character
var text = new txt.Text( {
text:'The fox jumped over the log.',
font:'raleway',
align:txt.Align.TOP_RIGHT,
tracking:-4,
character:{
click:function( event ){
console.log( 'click');
}
},