This file contains hidden or 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
| # Console2 Settings can be reached by pressing Ctrl + Alt + S | |
| # Use nano instead of vim | |
| EDITOR=nano | |
| # always list in long format | |
| alias ls='ls -la --color' | |
| # set dynamic prompt and window/tab title | |
| PS1='\[\e]0;${PWD##*/}\a\]\n' # set window title |
This file contains hidden or 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
| /** | |
| * Find a unique slug. | |
| * | |
| * @see https://github.com/cocur/slugify | |
| * @param $text | |
| * | |
| * @return string | |
| */ | |
| public static function getUniqueSlug($text) | |
| { |
This file contains hidden or 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
| /** | |
| * Use default vlaue | |
| */ | |
| _.mixin({ | |
| default: function(value, default_val) { | |
| if (value === null && typeof value === "object") { | |
| return default_val; | |
| } | |
| return _.isUndefined(value) || _.isNull(value) ? default_val : value; | |
| } |
This file contains hidden or 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
| /** | |
| * @author Dan Richards <drichards@shapeup.com> | |
| * | |
| * Assumes a compiled handlebars template is available. | |
| * @see http://handlebarsjs.com/precompilation.html | |
| */ | |
| (function ($) { | |
| $.extend({ | |
| alert: function(message, params) { | |
| var alertContainer = $('#alerts'); |
This file contains hidden or 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
| /** | |
| * Provided a data Object, set the corresponding form fields. | |
| * | |
| * @param obj Object Your data. | |
| * @return Array Fields updated. | |
| */ | |
| $.fn.populate = function(obj) { | |
| var updated = []; | |
| for (var field in obj) { |
This file contains hidden or 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
| /** | |
| * SubmitWizard | |
| * | |
| * @returns {SubmitWizard} | |
| * @constructor | |
| */ | |
| function SubmitWizard(options) { | |
| var that = this; | |
| /** |
This file contains hidden or 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 | |
| /** | |
| * Provided a threshold, determine modulo to keep every m-th item in the | |
| * array where m = ceil(count($array) / $threshold) | |
| * | |
| * @param $arr | |
| * @param $threshold | |
| * @param string $round |
This file contains hidden or 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
| // https://jsfiddle.net/danrichards/16mxh9th/ | |
| _.mixin({ | |
| isIE: function(mixed) { | |
| if (_.isUndefined(mixed)) { | |
| mixed = [/MSIE\s7\./, /MSIE\s8\./, /MSIE\s9\./, /MSIE\s10\./, /Trident.*rv\:11\./]; | |
| } else if (_.isArray(mixed)) { | |
| mixed = mixed.map(function(browser) { | |
| return new RegExp('MSIE\s'+browser.toString()+'\.', 'g'); | |
| }); |
This file contains hidden or 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
| (function ( $ ) { | |
| $.fn.addPasswordStrengthMeter = function(meter_el) { | |
| var that = this; | |
| if (typeof meter_el == 'undefined') { | |
| meter_el = $('.password-strength-meter'); | |
| } | |
| var bars = meter_el.children(); |
This file contains hidden or 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 area is for mounting global JS objects. --}} | |
| <script> | |
| "use strict"; | |
| /** | |
| * Please keep App and its dependencies lean. It's loaded everywhere. | |
| * | |
| * @constructor |
OlderNewer