Skip to content

Instantly share code, notes, and snippets.

View diverted247's full-sized avatar

Ted Patrick diverted247

View GitHub Profile
@diverted247
diverted247 / The second stage error wall... 555 errors
Created February 27, 2014 20:23
Porting TS 0.8.3 to TS 0.9.7
app/interfaces/IApplicationMode.ts(6,15): error TS2095: Could not find symbol 'bool'.
app/interfaces/IWindow.ts(4,19): error TS2095: Could not find symbol 'bool'.
app/interfaces/IGuidedTip.ts(3,22): error TS2095: Could not find symbol 'bool'.
app/interfaces/IGuidedTip.ts(5,28): error TS2095: Could not find symbol 'bool'.
app/app.ts(39,27): error TS2095: Could not find symbol 'bool'.
app/app.ts(40,25): error TS2095: Could not find symbol 'bool'.
app/app.ts(41,32): error TS2095: Could not find symbol 'bool'.
app/app.ts(42,34): error TS2095: Could not find symbol 'bool'.
app/app.ts(44,35): error TS2095: Could not find symbol 'bool'.
app/app.ts(46,23): error TS2095: Could not find symbol 'bool'.
@diverted247
diverted247 / vuejs.d.ts
Created March 15, 2014 20:06
Early Version of VueJS Type Defintion
declare var Vue: VueStatic;
interface VueObject{
}
interface VueMethods{
[n: string]: Function;
}
interface VueAttributes{
@diverted247
diverted247 / MyView.ts
Created March 16, 2014 17:30
A TSVue API Example... TypeScript Wrapper for Vuejs
class MyView extends TSVue {
map:{
data:['a']
methods:['plus'],
computed:['aplus']
}
plus(){
this.a++;
@diverted247
diverted247 / IN > Storage.ts
Last active April 11, 2025 16:45
TypeScript 0.9.7 AMD Modules using import and require()
export class Storage{
static STORAGE_KEY:string = 'todos-vuejs';
static todos:any = null;
static fetch(){
if( !Storage.todos ){
Storage.todos = JSON.parse( localStorage.getItem( Storage.STORAGE_KEY ) || '[]' );
}
return Storage.todos;
}
@diverted247
diverted247 / IN > Storage.ts
Created March 18, 2014 18:57
TypeScript 0.9.7 CommonJS Modules using import and require()
export class Storage{
static STORAGE_KEY:string = 'todos-vuejs';
static todos:any = null;
static fetch(){
if( !Storage.todos ){
Storage.todos = JSON.parse( localStorage.getItem( Storage.STORAGE_KEY ) || '[]' );
}
return Storage.todos;
}
@diverted247
diverted247 / app.ts
Created March 21, 2014 16:48
TypeScript + VueJS - Module Path Attempt
/// <reference path='../../../tools/vue/vue.0.10.0RC.d.ts'/>
var Router:any;
module app{
export module sorting{
export var ALL = 'all';
export var ACTIVE = 'active';
export var COMPLETED = 'completed';
@diverted247
diverted247 / app.ts
Created March 21, 2014 16:51
TypeScript + VueJS - Class Path Attempt
declare var Vue:any;
declare var Router:any;
interface ToDo{
title:string;
completed:boolean;
$data?:any;
}
module app{
@diverted247
diverted247 / svgpath2point.js
Created April 25, 2014 18:09
SVGPath to Points Array in CasperJS
//install--> npm install -g casperjs
//run --> casperjs svgpath2point.js
var casper = require('casper').create();
casper.start();
var d = "M 226 159.333333333333 C 350.816352746667 159.333333333333 452 123.665351484444 452 79.6666666666667 C 452 35.667981848889 350.816352746667 0 226 0 C 101.183647253333 0 0 35.667981848889 0 79.6666666666667 C 0 123.665351484444 101.183647253333 159.333333333333 226 159.333333333333 Z";
casper.then( function() {
@diverted247
diverted247 / gulpfile.js
Created May 1, 2014 18:15
A Gulp + TypeScript + Component Build script
var gulp = require( 'gulp' ),
component = require( 'gulp-component' ),
tsc = require( 'gulp-typescript-compiler' );
gulp.task( 'default' , [ 'ts' ] , function (){
gulp.src( 'component.json' )
.pipe( component( {
standalone: true
} ) )
.pipe( gulp.dest( 'build' ) )
@diverted247
diverted247 / gist:496d6c19c9cc45adf267
Created May 28, 2014 15:43
Sub-class cannot access private variables in superclass
module foo{
export class Bar{
//private member age
private age:number = 6;
name:string = "Bob";
}
export class Foo extends Bar{