Skip to content

Instantly share code, notes, and snippets.

Avatar

Mrinal Wadhwa mrinalwadhwa

View GitHub Profile
View Example.as
package
{
import flash.display.Bitmap;
import flash.display.Sprite;
[Frame(factoryClass="com.mrinalwadhwa.ApplicationLoader")]
public class Example extends Sprite
{
View ApplicationLoader.as
package com.mrinalwadhwa
{
import flash.display.DisplayObject;
import flash.display.MovieClip;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.utils.Dictionary;
View SomeModel.as
package
{
import crayons.signals.ChangeSignal;
public class SomeModel
{
private var _data:String;
public var dataChanged:ChangeSignal;
public function SomeModel()
View Example.as
package
{
import flash.text.TextField;
import flash.display.Sprite;
import crayons.data.binding.Binder;
public class Example extends Sprite
{
private var source:SomeModel;
private var target:TextField;
View DuffsDevicePerfTest.as
protected function while_loop1():void {
var l:int = 500000000,
i:int = 0;
while (i < l){
i++;
}
}
@mrinalwadhwa
mrinalwadhwa / file_utils.erl
Created Jul 2, 2011
Erlang: list all the files in a directory and recursively in all its sub directories
View file_utils.erl
-module(file_utils).
-export([recursively_list_dir/1,
recursively_list_dir/2]).
% @type name() = string() | atom() | binary().
-type name() :: string() | atom() | binary().
@mrinalwadhwa
mrinalwadhwa / justify.js
Created Jun 15, 2012
Justify text if hyphens:auto is supported
View justify.js
var addStyleSheet = document.createStyleSheet || function(styles){
var css = document.createElement('style');
css.setAttribute("type","text/css");
css.appendChild(document.createTextNode(styles));
document.getElementsByTagName('head')[0]).appendChild(css);
}
function isHyphensAutoSupported(result){
try {
var
View clearfix.css
/* based on http://www.yuiblog.com/blog/2010/09/27/clearfix-reloaded-overflowhidden-demystified/ */
.cf:before,
.cf:after {
content: ".";
display: block;
height: 0;
overflow: hidden;
}
.cf:after {clear: both;}
@mrinalwadhwa
mrinalwadhwa / ampersand.html
Created Jun 15, 2012
Ampersand — Goudy Bookletter 1911
View ampersand.html
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Ampersand</title>
<style>
@font-face {
font-family:"Goudy Bookletter 1911";
src:url('http://themes.googleusercontent.com/static/fonts/goudybookletter1911/v3/l5lwlGTN3pEY5Bf-rQEuIHkY3soKkPv_thL__S829Cw.eot#iefix') format('embedded-opentype'),
@mrinalwadhwa
mrinalwadhwa / index.html
Created Jun 15, 2012
CSS to make a div take the entire page, width & height 100%
View index.html
<!DOCTYPE html>
<!--[if lt IE 7]><html class="lt-ie9 lt-ie8 lt-ie7" lang="en"><![endif]-->
<!--[if IE 7]><html class="lt-ie9 lt-ie8" lang="en"><![endif]-->
<!--[if IE 8]><html class="lt-ie9" lang="en"><![endif]-->
<!--[if gt IE 8]><!--><html lang="en"><!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Box</title>
<style>
You can’t perform that action at this time.