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 addHourTo(start, duration) { | |
start = start.split(':'); | |
duration = duration.split(':'); | |
totalHours = parseInt(start[0], 10) + parseInt(duration[0], 10); | |
totalMinutes = parseInt(start[1], 10) + parseInt(duration[1], 10); | |
if (totalMinutes >= 60) { | |
totalMinutes -= 60; | |
totalHours += 1; |
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
//Usage | |
try { | |
$(window).on('load', function() { | |
equalize_height($('#parent'), '.element'); | |
}); | |
$(window).resize(function(){ | |
equalize_height($('#parent'), '.element'); | |
}); | |
} catch(err) {console.log(err);} |
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($) { | |
if ($.fn.style) { | |
return; | |
} | |
// Escape regex chars with \ | |
var escape = function(text) { | |
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/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
<?php | |
if ( !class_exists('Primped_Base_Singleton') ): | |
abstract class Primped_Base_Singleton { | |
/** | |
* Parsed options for module | |
* | |
* @var 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
<table class="form-table"> | |
<tbody> | |
<tr> | |
<th scope="row"><label>Example:</label></th> | |
<td> | |
<select name="select-name-whenever"> | |
<option>1</option> | |
<option>lorem</option> | |
</select> | |
</td> |
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 | |
$comments_per_page = 2; | |
$page = 2; | |
//MYSQL: LIMIT offset, number | |
$params = array( | |
'post_id' => $post_id, | |
'offset' => (--$page) * $comments_per_page, | |
'number' => $comments_per_page, | |
); |
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 | |
/** | |
* Check if value is currency $value | |
* | |
* Pass on: | |
* 1,000,000.00 | |
* 10,000.00 | |
* 1,000.00 | |
* 100.00 |
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/hooks/pre-commit | |
#chmod +x pre-commit | |
#http://www.phil-barker.com/2013/07/syntax-check-your-php-before-git-commit/ | |
#!/usr/bin/php | |
<?php | |
// Grab all added, copied or modified files into $output array | |
exec('git diff --cached --name-status --diff-filter=ACM', $output); | |
foreach ($output as $file) { | |
$fileName = trim(substr($file, 1)); |
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
AdvancedNewFile | |
Alignment | |
Autoprefixer(css3) | |
Color Highlitgther (show the color on mouse over) | |
DocBlockr (For Documentation PHPDocs, CSSDocs, JSDocs...) | |
Emmet | |
File Diffs | |
Git Conflict Resolver (very useful to identify where's the conflict in your file) | |
HTML-CSS-JS Prettify (minify files .min) | |
Minifier( Same as above) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.