Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Omar F omarfouad

💭
I may be slow to respond.
Block or report user

Report or block omarfouad

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
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"
},
{
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);
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.
#
@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;
}
You can’t perform that action at this time.