Skip to content

Instantly share code, notes, and snippets.

View heartcode's full-sized avatar

Robert Pataki heartcode

View GitHub Profile
@heartcode
heartcode / Default (OSX).sublime-keymap
Created April 18, 2012 19:02
Sublime Text 2 | Key Bindings - User
[
{ "keys": ["super+m"], "command": "toggle_minimap" },
{ "keys": ["super+d"], "command": "duplicate_line" },
{ "keys": ["super+up"], "command": "swap_line_up" },
{ "keys": ["super+down"], "command": "swap_line_down" }
]
@heartcode
heartcode / TLFFactory.as
Created March 1, 2012 15:16
A simple class for creating TLFTextFields
package com.waste.assets.tlf
{
import fl.text.*;
import flash.text.*;
import flash.text.engine.FontLookup;
import flashx.textLayout.formats.*;
import flashx.textLayout.formats.TextLayoutFormat;
import flashx.textLayout.elements.TextFlow;
/**
@heartcode
heartcode / FontLibrary.as
Created February 29, 2012 15:25
(unicodeRange) Font embedding for ActionScript projects using Flex 4.0+ SDK
package com.heartcode.utils.fonts
{
import flash.display.Sprite;
import flash.events.Event;
import flash.text.Font;
/**
*
*/
public class FontLibrary extends Sprite
@heartcode
heartcode / scroll-window-to.js
Created February 11, 2012 23:23
Scrolls the window to the required position (Please note that this snippet works best with top scrolling just for now)
/*
* Scrolls the window to the required position using animation with custom easing.
* The required position can be set with the 1st argument ('position');
* The fineness of the animation can be customized by using the 'speed' (2nd) argument, which ranges between 0.1 (very fine) and 1 (instant jump).
* Usage #1:
* scrollWindowTo(0, 0.2); // -> Scrolls the page to the top with a fine animation
* Usage #2:
* scrollWindowTo(100, 1); // -> Makes the page jump to 100px
*/
var scrollWindowTo = (function(){