Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Omar F omarfouad

💭
I may be slow to respond.
View GitHub Profile
@omarfouad
omarfouad / us_states.json
Last active Aug 29, 2015
A JSON array of US States with name and abbreviations
View us_states.json
[
{
"name": "Alabama",
"abbreviation": "AL"
},
{
"name": "Alaska",
"abbreviation": "AK"
},
{
@omarfouad
omarfouad / ClockFormats.as
Created Apr 11, 2011
The same function written two ways.
View ClockFormats.as
//Traditional Way
public function getClockFormat1(milliseconds:Number):String
{
var seconds:Number = milliseconds / 1000;
var m:int = 0;
if (seconds > 0) {
while (seconds > 59) {
m++;
seconds -= 60;
}
View page_generator.rb
module Jekyll
class Pagination < Generator
# This generator is safe from arbitrary code execution.
safe true
# Generate paginated pages if necessary.
#
# site - The Site.
#
View jQuery HTML5 placeholder fix.js
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php
$('[placeholder]').focus(function() {
var input = $(this);
if (input.val() == input.attr('placeholder')) {
input.val('');
input.removeClass('placeholder');
}
}).blur(function() {
var input = $(this);