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
#!/bin/sh | |
# | |
# Read old version from file, make new version, save to file | |
# file VERSION should be in the root of the project, beside README | |
# VERSION should *always* be formatted according to GNU version scheme: major.minor.revision | |
version=$(< VERSION) | |
major=`echo $version | awk -F"." '{print $1}'` | |
minor=`echo $version | awk -F"." '{print $2}'` |
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 | |
class Filesearch { | |
// Config | |
public $string = ''; | |
public $extensions = array(); | |
public $dir = ''; | |
public $exclude = array(); | |
public $in_files = true; | |
public $matcher = 'ci'; |
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 | |
$a1 = array('x', 'a' => 'b', 'c', 'd', 'e'); | |
print_r($a1); | |
var_dump(is_numeric_array($a1)); // false | |
$a2 = array('a', 'b', 'c', 'd', 'e'); | |
print_r($a2); |
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
window.setTimeout(function() { | |
if ( !arguments.length ) { | |
// polyfill | |
var sto = window.setTimeout; | |
window.setTimeout = function(cb, speed) { | |
var args = []; | |
for ( var i=2; i<arguments.length; i++ ) { | |
args.push(arguments[i]); | |
} | |
sto(function() { |
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 | |
// Example: http://hotblocks.nl/tests/time_ago.php | |
function time_ago( $f_seconds, $f_size = 2, $f_factor = 1.6 ) { | |
$units = array( | |
86400*365.25 => array(' year', ' years'), | |
86400*30 => array(' month', ' months'), | |
86400*7 => array(' week', ' weeks'), | |
86400 => array(' day', ' days'), |
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
/** | |
* Double Opacity | |
*/ | |
body{background:green;} | |
#baz{ | |
opacity: 0.6; | |
} | |
#foo{ | |
height:150px; |
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
/** | |
* `url` can be a data URI like data: or a blob URI like blob: or an existing, public resource like http: | |
* `filename` is the (default) name the file will be downloaded as | |
*/ | |
function download( url, filename ) { | |
var link = document.createElement('a'); | |
link.setAttribute('href',url); | |
link.setAttribute('download',filename); | |
var event = document.createEvent('MouseEvents'); | |
event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null); |
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 seen in bozo/custom.js | |
(function($) { | |
Drupal.behaviors.placeholderPolyfill = { | |
attach: function(context, settings) { | |
if ( !('placeholder' in document.createElement('input')) ) { | |
var onFocus = function(e) { | |
this.$this || (this.$this = $(this)); |
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
Element.prototype.matchesSelector || (Element.prototype.matchesSelector = Element.prototype.webkitMatchesSelector || Element.prototype.mozMatchesSelector || function(selecta) { | |
var els = document.querySelectorAll(selecta); | |
for ( var i=0, L=els.length; i<L; i++ ) { | |
if ( els[i] == this ) { | |
return true; | |
} | |
} | |
return false; | |
}); |
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 /* | |
exports.user = 'root'; | |
exports.password = 'secret password'; | |
exports.database = 'games'; | |
// */ |
OlderNewer