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 | |
| function get_closure_params(\Closure $fn){ | |
| preg_match_all('/\[\$(.+)\]/', print_r($fn, true), $matches); | |
| return isset($matches[1]) ? $matches[1] : array(); | |
| } |
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
| $.fn.fitFontSize = function(minFontSize, containerWidth){ | |
| minFontSize = minFontSize || 12; | |
| return this.each(function(){ | |
| var $this = $(this); | |
| var sectionWidth = containerWidth || $this.parent().innerWidth(); | |
| var spanWidth = $this.width(); | |
| var newFontSize = (sectionWidth/spanWidth) * minFontSize; | |
| $this.css({"font-size" : newFontSize, "line-height" : (newFontSize+2) + "px"}); | |
| }); | |
| }; |
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 | |
| function facebook_url_stats($urls, $orderBy = "ORDER BY like_count DESC") { | |
| $urls = implode("', '", $urls); | |
| $urls = "'" . $urls . "'"; | |
| $fql = "SELECT url, normalized_url, share_count, like_count, comment_count, "; | |
| $fql .= "total_count, commentsbox_count, comments_fbid, click_count FROM "; | |
| $fql .= "link_stat WHERE url IN ({$urls}) {$orderBy}"; |
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 loadTemplates(templates, callback) { | |
| var _loadCount = 0; | |
| $('body').bind('templates_loaded', callback); | |
| if(templates.length === 0){ | |
| $('body').trigger('templates_loaded'); | |
| }else{ | |
| $(templates).each(function(i, el) { | |
| var _tpl = $('<script>'); | |
| _tpl.attr('type', 'text/x-handlebars'); |
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 | |
| error_reporting(-1); | |
| ini_set('display_errors', true); | |
| echo '<h1>PHP permission test</h1>'; | |
| $currdir = realpath(dirname(__FILE__)); | |
| $testdir = $currdir . '/' . time(); | |
| $testfile = $testdir . '/mytest.txt'; |
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 is a merge of the node slugize-component module | |
| Usage: $str.slugize('SómE StrïNG'); | |
| */ | |
| (function(){ | |
| var special = ['À','à','Á','á','Â','â','Ã','ã','Ä','ä','Å','å','Ă','ă','Ą','ą','Ć' | |
| , 'ć','Č','č','Ç','ç','Ď','ď','Đ','đ', 'È','è','É','é','Ê','ê','Ë','ë' | |
| , 'Ě','ě','Ę','ę','Ğ','ğ','Ì','ì','Í','í','Î','î','Ï','ï', 'Ĺ','ĺ','Ľ' | |
| , 'ľ','Ł','ł','Ñ','ñ','Ň','ň','Ń','ń','Ò','ò','Ó','ó','Ô','ô','Õ','õ' | |
| , 'Ö','ö','Ø','ø','ő','Ř','ř','Ŕ','ŕ','Š','š','Ş','ş','Ś','ś','Ť','ť' |
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 | |
| function url_path(){ | |
| // Base path | |
| $script_name = isset($_SERVER["SCRIPT_NAME"]) ? $_SERVER["SCRIPT_NAME"] : ''; | |
| $base_path = ''; | |
| if (!empty($script_name)) { | |
| $base_path = trim(str_replace('\\', '/', dirname($script_name)), '/ '); | |
| } | |
| // Path |
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
| $.fn.skrollto = function(speed, easing) { | |
| speed = speed || 1000; | |
| easing = easing || 'swing'; | |
| return $(this).each(function(i, el){ | |
| //calculate destination place | |
| var dest = 0; | |
| var el = $(this); | |
| if (el.is(':hidden')) { |
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 | |
| class ClassLoader{ | |
| protected $prefixes = array(); | |
| protected $fallbackDirs = array(); | |
| protected $useIncludePath = false; | |
| protected $classMap = array(); | |
| protected $history = array(); |