Skip to content

Instantly share code, notes, and snippets.

View diverted247's full-sized avatar

Ted Patrick diverted247

View GitHub Profile
@diverted247
diverted247 / gist:9056350
Created February 17, 2014 18:35
Kerning data from .svg font for use on <canvas>
font_family|Amadeo_W01_Bold_SC
ascent|532
descent|-468
units-per-em|1000
horiz-adv-x|410
!|172
#|557
$|459
%|542
&|281
@diverted247
diverted247 / gist:9056925
Created February 17, 2014 19:08
Kerning data from Century Gothic
font_family|Century_Gothic_W15
ascent|781
descent|-220
units-per-em|1000
horiz-adv-x|563
|0
|277
!|295
"|309
#|720
@diverted247
diverted247 / gist:9077955
Created February 18, 2014 19:20
Value encoding for kerning data. Removes all redundancy between single char and pairs
-1|04|64|84|Ko|Kò|Kó|Kô|Kõ|Kö|LS|LŠ|kg|vs|vš
-10|BÆ|CÆ|tS|tŠ|ÇÆ
-11|y:|ý:|ÿ:
-12|A,|ff|rr|ta|tà|tá|tâ|tã|tä|tå|tæ|À,|Á,|Â,|Ã,|Ä,|Å,
-13|ft|rn|rñ
-14|Aa|Aà|Aá|Aâ|Aã|Aä|Aå|r-|r;|ri|rj|rx|Àa|Àà|Àá|Àâ|Àã|Àä|Àå|Áa|Áà|Áá|Áâ|Áã|Áä|Áå|Âa|Âà|Âá|Ââ|Âã|Âä|Âå|Ãa|Ãà|Ãá|Ãâ|Ãã|Ãä|Ãå|Äa|Äà|Äá|Äâ|Äã|Ää|Äå|Åa|Åà|Åá|Åâ|Åã|Åä|Åå
-15|A.|À.|Á.|Â.|Ã.|Ä.|Å.
-16|rp
-17|rf|ru|rù|rú|rû|rü
-18|v;
@diverted247
diverted247 / Input TypeScript
Created February 26, 2014 17:30
TypeScript 1.0 Enum
enum foo {
A,
B,
C,
D
}
@diverted247
diverted247 / The first stage error wall...
Created February 27, 2014 18:58
Porting TS 0.8.3 to TS 0.9.7
/build/app/app.ts(145,35): error TS1015: Parameter cannot have question mark and initializer.
/build/app/app.ts(801,34): error TS1015: Parameter cannot have question mark and initializer.
/build/app/managers/FontManager.ts(114,48): error TS1015: Parameter cannot have question mark and initializer.
/build/app/managers/FontManager.ts(175,53): error TS1015: Parameter cannot have question mark and initializer.
/build/app/managers/ServiceManager.ts(670,10): error TS1008: Unexpected token; 'constructor, function, accessor or variable' expected.
/build/app/managers/ErrorManager.ts(66,37): error TS1015: Parameter cannot have question mark and initializer.
/build/app/managers/ErrorManager.ts(70,39): error TS1015: Parameter cannot have question mark and initializer.
/build/app/managers/ErrorManager.ts(74,36): error TS1015: Parameter cannot have question mark and initializer.
/build/app/managers/ErrorManager.ts(78,37): error TS1015: Parameter cannot have question mark and initializer.
/build/app/managers/ImageManager.ts
@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
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';