This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// iterates through an array and calls the appropriate function | |
foreach ($key_array as $key_name) { | |
if(array_key_exists($key_name, $settings)) { | |
$function = 'set' . ucwords($key_name); | |
$this->$function($settings[$key_name]); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Parsing google calendar xml feed **/ | |
class GoogleCal { | |
protected $feed_url; | |
protected $data; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install grunt --save-dev && npm install time-grunt --save && npm install load-grunt-config --save-dev && npm install grunt-concurrent --save-dev && npm install grunt-contrib-clean --save-dev && npm install grunt-contrib-imagemin --save-dev && npm install grunt-contrib-uglify --save-dev && npm install grunt-contrib-csslint --save-dev && npm install grunt-contrib-jshint --save-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// module pattern in case i add a callback / task queue list | |
var task = function (tasks) { | |
return { | |
run: function() { | |
// run task | |
grunt.task.run(tasks); | |
}, | |
on: function(val, callback) { | |
// run task | |
this.run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.full-width-image { | |
/* height 0 padding-bottom hack */ | |
height: 0; | |
/* contain stretches to largest */ | |
background-size: contain; | |
background-repeat: no-repeat; | |
} | |
.bg { | |
/* percentage relative to image ratio */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// as a function | |
var isLike = function(set) { | |
if ((set[0].localeCompare(set[1], 'en', {sensitivity: 'base'})) !== 0) { | |
return false; | |
} | |
return true; | |
}; | |
var is = isLike(['a', 'A']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 'pojo' idiom for namespacing javascript | |
var namespace = {}; | |
var x = 'fn'; | |
namespace.fn = function() { | |
console.log('fin'); | |
} | |
// execute function by string name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('a[href="javascript:;"]').bind('click', function(e) { | |
var target; | |
e.preventDefault(); | |
e.stopPropagation(); | |
target = $(this).data('section'); | |
$('#' + target).velocity('scroll', { | |
duration: 500, | |
offset: -40, | |
easing: 'ease-out' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This gist creates maintainable, DRY, responsive header classes and selectors that allow for unqualified property attribution, semantic markup without class-stacking, and minimal compiled css by using a loop to create heading selectors and placeholders from a simple data structure. | |
// To implement, adjust the sizes in the map. Heading selectors will be compiled. Placeholders that reference the heading size can be extended in any element. | |
// There are issues using placeholders inside media-queries. These are being addressed. | |
// See the references at the top of the gist for more information. | |
// http://blog.millermedeiros.com/the-problem-with-css-pre-processors/ | |
// http://thesassway.com/intermediate/understanding-placeholder-selectors | |
// http://www.sitepoint.com/using-sass-maps/ | |
// http://webdesign.tutsplus.com/tutorials/all-you-ever-need-to-know-about-sass-interpolation--cms-21375 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- references: --> | |
<!-- accessibility --> | |
<!-- semantics --> | |
<!-- idiomatic markup --> | |
<!-- modular components --> | |
<!-- css class selector performance --> | |
<!-- js id selector performance --> | |
<!-- object-oriented-like css classes --> | |
<!-- good example --> |
OlderNewer