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
/** | |
* Simple debug trace to wp-content/debug.log | |
* | |
* @usage _log( $var ); | |
*/ | |
if ( ! function_exists( '_log' ) ) { | |
function _log() { | |
$args = func_get_args(); |
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 | |
/** | |
* is_edit_page | |
* function to check if the current page is a post edit page | |
* | |
* @author Ohad Raz <admin@bainternet.info> | |
* @url https://wordpress.stackexchange.com/questions/50043 | |
* | |
* @param string $new_edit what page to check for accepts new - new post page ,edit - edit post page, null for either | |
* @return boolean |
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
/** | |
* Simple debug trace to the end of the page | |
* | |
* @usage d( $data ); | |
*/ | |
if ( true === WP_DEBUG ) { | |
function d( $data ) { |
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
@mixin valid-quantity($quantity) { | |
@if type-of($quantity) != 'number' { | |
@error 'The "quantity" parameter must be a number!'; | |
} | |
@if not(unitless($quantity)) { | |
@error 'The "quantity" parameter must not have a unit!'; | |
} | |
@if $quantity < 0 { | |
@error 'The "quantity" parameter must be at least 0!'; | |
} |
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
var | |
// global | |
gulp = require('gulp'), | |
watch = require('gulp-watch'), | |
browserSync = require("browser-sync"), | |
reload = browserSync.reload, | |
sass = require('gulp-sass'), | |
prefixer = require('gulp-autoprefixer'), | |
cssnano = require('gulp-cssnano'), |
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
/** | |
* Debounce and throttle helper function's | |
* | |
* https://remysharp.com/2010/07/21/throttling-function-calls | |
* | |
* Examples: | |
* $('input.username').keypress(debounce(function (event) { | |
* // do the Ajax request | |
* }, 250)); | |
* |
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
$breakpoints: ( | |
xsmall: 0, | |
small: 480px, | |
medium: 768px, | |
large: 992px, | |
xlarge: 1024px, | |
//xlarge: 1200px, | |
//xxlarge: 1200px, | |
) !default; |
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 | |
// Make dump of database via php | |
exec('mysqldump --user=__user_name__ --password=__user_pass__ --host=__host(localhost)__ __db_name__ > dump.sql'); | |
print_r('Dump saved'); |
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
<div id="page" class="site"> | |
<header id="masthead" class="site-header" role="banner"></header> | |
</div> |
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
// To see how it works, copy this code and paste on http://www.sassmeister.com/ | |
//Font-face mixin | |
//Generate font src string | |
@function font-src-list($formats, $local, $name, $path, $weight, $type) { | |
$string: unquote('') !default; | |
$i: 1; | |
@if $local { | |
@each $item in $local { | |
$string: $string + unquote('local("#{$item}"), '); | |
} |