Skip to content

Instantly share code, notes, and snippets.

Avatar

Jon Falcon jonfalcon

  • Davao City, Philippines
View GitHub Profile
@jonfalcon
jonfalcon / object-keys-polyfill.js
Created Feb 5, 2013
Javascript: Object keys polyfill
View object-keys-polyfill.js
/**
* Polyfill for Object.keys
*
* @see: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/keys
*/
if (!Object.keys) {
Object.keys = (function () {
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
dontEnums = [
@jonfalcon
jonfalcon / gradient-text-shadow-buttons.less
Created Feb 5, 2013
CSS: Linear Gradient and Text Shadow for Buttons - less mixins
View gradient-text-shadow-buttons.less
.linear-gradient( @from, @to ) {
background-color: @to;
background-image: -webkit-gradient(linear, left top, left bottom, from(@from), to(@to)); /* Safari 4+, Chrome */
background-image: -webkit-linear-gradient(top, @from, @to); /* Chrome 10+, Safari 5.1+, iOS 5+ */
background-image: -moz-linear-gradient(top, @from, @to); /* Firefox 3.6-15 */
background-image: -o-linear-gradient(top, @from, @to); /* Opera 11.10-12.00 */
background-image: linear-gradient(to bottom, @from, @to); /* Firefox 16+, IE10, Opera 12.50+ */
}
.linear-gradient( @from, @to: 0 ) when( @to = 0 ) {
@jonfalcon
jonfalcon / less-rounded-corner-mixins.less
Created Feb 5, 2013
CSS: rounder corners - less mixins
View less-rounded-corner-mixins.less
// Border Radius
.border-radius(@_, @radius){
-moz-background-clip: padding;
-webkit-background-clip: padding-box;
background-clip: padding-box;
}
.border-radius(all, @radius) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
@jonfalcon
jonfalcon / wordpress-plugin-snippets.php
Created Feb 5, 2013
PHP: Wordpress Plugin Snippet
View wordpress-plugin-snippets.php
<?php
/**
* Plugin Name: Plugin
* Description: Description
* Author: Jon Falcon
* Version: 1.0
*/
// Copyright (C) 2013 Jon Falcon
// This program is free software: you can redistribute it and/or modify