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 freierTag($tag, $monat, $jahr) | |
{ | |
// Parameter in richtiges Format bringen | |
if(strlen($tag) == 1) { | |
$tag = "0$tag"; | |
} | |
if(strlen($monat) == 1) { | |
$monat = "0$monat"; | |
} |
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 validateDate( intDay, intMonth, intYear ) | |
{ | |
return intMonth >= 1 && intMonth <= 12 && intDay > 0 && intDay <= daysInMonth( intMonth, intYear ); | |
} | |
function daysInMonth( intMonth, intYear ) | |
{ | |
switch ( intMonth ) | |
{ | |
case 2: |
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
$str = 'In My Cart : 11 12 items'; | |
preg_match_all('!\d+!', $str, $matches); | |
print_r($matches); |
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
git whatchanged --since="2 year ago" --until="1 year ago" [--author="NAME_OF_THE_AUTHOR"] |
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
$("#loader").toggleClass('fadeOut',600).promise().done(function(){ | |
alert('a'); | |
}); |
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
// Speed up calls to hasOwnProperty | |
var hasOwnProperty = Object.prototype.hasOwnProperty; | |
function is_empty(obj) { | |
// null and undefined are empty | |
if (obj === null) return true; | |
// Assume if it has a length property with a non-zero value | |
// that that property is correct. | |
if (obj.length && obj.length > 0) return false; |
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
for (var key in p) { | |
if (p.hasOwnProperty(key)) { | |
alert(key + " -> " + p[key]); | |
} | |
} |
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 the last commit that affected the given path. As the file isn't in the HEAD commit, this commit must have deleted it.*/ | |
git rev-list -n 1 HEAD -- <file_path> | |
// Then checkout the version at the commit before | |
git checkout <deleting_commit>^ -- <file_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
git show experiment:path/to/app.js | |
git show experiment:path/to/app.js > path/to/app.js /* In order to copy the file of expermient branch to our current branch */ |