Skip to content

Instantly share code, notes, and snippets.

View diverted247's full-sized avatar

Ted Patrick diverted247

View GitHub Profile
@diverted247
diverted247 / gist:5981598
Created July 12, 2013 04:51
tizen global object
tizen
AlarmAbsolute: CallbackConstructor
getNextScheduledDate()
AlarmRelative: CallbackConstructor
getRemainingSeconds()
ApplicationControl: CallbackConstructor
<?xml version="1.0" encoding="UTF-8"?>
<Template pageCount="2" layoutType="Bussiness Card - Full Color" bleedBottom="4.5" hc_siteId="3439119e-8b58-4c7a-8ada-7c59545b149c" width="252" deliveryMedium="Print" hc_variationId="d22df98a-9451-466f-8d78-8e36f310a6fe" hc_numberOfScenes="" bleedOutside="4.5" hc_pagesPerScene="" hc_fontSet="Business Stationery Set" componentTypeId="" hc_campaign="" bleedInside="4.5" rulerUnits="inches" servicesVersion="" ATScriptVersion="0.6" id="BCHFC1360780885.indd" impositionInfo="" hc_isMultiScene="false" addPages="" conversionInfo="" hc_productId="dcd592eb-d6b0-42c7-8ba8-1b9666fe80ec" colorTheme="" height="144" ATCustomScriptVersion="0.05" hc_productVersion="" layoutSubtype="3.5x2 with 2 pages" FlexAppVersion="NFC-1109" TemplateEditorVersion="" hc_autoAddBack="False" hc_compositionBlackInkOnly="False" type="Page" bleedTop="4.5" productInfo="displayName=3.5x2 with 2 pages|dimensions=3.5x2|defaultSet=Base Set|allowNewImageRegions=True|allowNewTextRegions=True|allowOnlySizeSelection
@diverted247
diverted247 / gist:6136070
Created August 1, 2013 22:54
A business card in json
[{"LayoutBookMap":{"_die":"","_hc_isMultiScene":"false","_layoutType":"Bussiness Card - Full Color","fonts":{"Font":{"_fontFamily":"Mahsuri Sans MT Std","fontVariant":[{"_designerWeight":"normal","_fontServiceId":"","_fontStyle":"Regular","_designerLabelId":"","_fileName":"MahsuriSansMTStd.otf","_designerStyle":"normal","_fontId":"mahsuri_sans_mt_std","_designerLabel":"Mahsuri Sans MT Std","_postScriptName":"MahsuriSansMTStd","_fontServiceFamilyName":"","_type":"OTF CFF","_fullName":"Mahsuri Sans MT Std","_source":"MahsuriSansMTStd.swf","_htmlFontFamily":"Mahsuri Sans MT W01"},{"_designerWeight":"bold","_fontServiceId":"","_fontStyle":"Bold","_designerLabelId":"","_fileName":"MahsuriSansMTStd-Bol.otf","_designerStyle":"normal","_fontId":"mahsuri_sans_mt_std_bold","_designerLabel":"Mahsuri Sans MT Std Bold","_postScriptName":"MahsuriSansMTStd-Bold","_fontServiceFamilyName":"","_type":"OTF CFF","_fullName":"Mahsuri Sans MT Std Bold","_source":"MahsuriSansMTStdBold.swf","_htmlFontFamily":"MahsuriSansMTW01-Bold"}
module hist.utils {
// TypeScript Port of http://clauswitt.com/simple-statistics-in-javascript.html
// https://gist.github.com/clauswitt/1285478
// Use:
// var stats = new hist.utils.Stats( [ 1 , 2 , 3 , 4 , 5 , 6 ] );
// stats.getArithmeticMean();
// stats.getGeometricMean();
@diverted247
diverted247 / gist:6443114
Created September 4, 2013 21:28
TypeScript output on Refactoring editors
[exec] /coderoot/big-box-js/main/build/app/controls/ComponentFactory.ts(5,31): Expected type
[exec] /coderoot/big-box-js/main/build/app/controls/ComponentFactory.ts(7,49): Expected type
[exec] /coderoot/big-box-js/main/build/app/controls/GroupContainer.ts(10,24): Expected type
[exec] /coderoot/big-box-js/main/build/app/controls/DOMText.ts(43,15): Expected type
[exec] /coderoot/big-box-js/main/build/app/editors/ContainerEdit.ts(51,20): The property 'html' does not exist on value of type 'HTMLElement'
[exec] /coderoot/big-box-js/main/build/app/editors/ImageEdit.ts(68,20): The property 'html' does not exist on value of type 'HTMLElement'
[exec] /coderoot/big-box-js/main/build/app/editors/TextEdit.ts(50,17): The property 'updateButtons' does not exist on value of type 'TextEdit'
[exec] /coderoot/big-box-js/main/build/app/controls/GroupContainer.ts(10,24): Expected type
[exec] /coderoot/big-box-js/main/build/app/controls/GroupContainer.ts(10,37): The property 'ContainerEdito
@diverted247
diverted247 / gist:6495409
Created September 9, 2013 13:14
TypeScript compatible live browser test for duplicate element ids via http://stackoverflow.com/questions/482763/jquery-to-check-for-duplicate-ids-in-a-dom
export function dupTest() {
var elms = document.getElementsByTagName( "*" ), i, len, ids = {}, id;
for( i = 0, len = elms.length; i < len; i += 1 ){
id = elms[ i ][ 'id' ] || null;
if( id ){
ids[ id ] = ids.hasOwnProperty( id ) ? ids[ id ] +=1 : 0;
}
}
for( id in ids ){
if( ids.hasOwnProperty( id ) ){
@diverted247
diverted247 / build_openresty_osx.sh
Created September 29, 2013 22:25
Build automation for Openresty + luajit + postgres on OSX
open_resty_version="ngx_openresty-1.4.2.7"
wget http://openresty.org/download/${open_resty_version}.tar.gz
tar xzvf ${open_resty_version}.tar.gz
cd ${open_resty_version}
brew install pcre
brew install postgresql
./configure --with-luajit --with-http_postgres_module --with-cc-opt="-I/usr/local/include" --with-ld-opt="-L/usr/local/lib"
make
make install
@diverted247
diverted247 / gist:6976567
Created October 14, 2013 14:30
Lapis - Select all users and render each in a div
lapis = require "lapis"
db = require "lapis.db"
html = require "lapis.html"
import Model from require "lapis.db.model"
class Users extends Model
class App extends lapis.Application
"/users": =>
@diverted247
diverted247 / gist:7391833
Created November 10, 2013 00:10
The essence of the module API in Angular 1.2
var module = angular.module( name, [] )
module.config( [ name , function ])
module.controller( name , [ function ] )
module.directive( name , [ name , function(){ return function } ] )
module.filter( name , [ name , function(){ return function } ] )
module.value( name , value )
@diverted247
diverted247 / Tang.ts
Created November 13, 2013 17:18
Tang early angular.Module proxy
declare var angular:any;
module tang{
export class Module{
instance:any;
constructor( name:string , requires?:string[] = [] , configFn?:any = null ){
this.instance = angular.module( name , requires , configFn );