Skip to content

Instantly share code, notes, and snippets.

View Woorg's full-sized avatar

Igor Gorlov Woorg

View GitHub Profile
@Woorg
Woorg / admin-functions.php
Created August 18, 2016 00:04 — forked from andregomes/admin-functions.php
Wordpress: Custom WordPress Admin Color Scheme
<?php
// Custom WordPress Admin Color Scheme
function admin_css() {
wp_enqueue_style( 'admin_css', get_template_directory_uri() . '/css/admin.css' );
}
add_action('admin_print_styles', 'admin_css' );
?>
<?php
$mycontent = $post->post_content; // wordpress users only
$word = str_word_count(strip_tags($mycontent));
$m = floor($word / 200);
$s = floor($word % 200 / (200 / 60));
$est = $m . ' minute' . ($m == 1 ? '' : 's') . ', ' . $s . ' second' . ($s == 1 ? '' : 's');
?>
<p>Estimated reading time: <?php echo $est; ?></p>
@Woorg
Woorg / wp-load-jqueryui.php
Created August 18, 2016 00:04 — forked from andregomes/wp-load-jqueryui.php
[WORDPRESS] Load JQuery UI
<?php
function add_jquery_ui() {
wp_enqueue_script( 'jquery-ui-core' );
wp_enqueue_script( 'jquery-ui-widget' );
wp_enqueue_script( 'jquery-ui-mouse' );
wp_enqueue_script( 'jquery-ui-accordion' );
wp_enqueue_script( 'jquery-ui-autocomplete' );
wp_enqueue_script( 'jquery-ui-slider' );
wp_enqueue_script( 'jquery-ui-tabs' );
wp_enqueue_script( 'jquery-ui-sortable' );
<?php
/**
* Load Enqueued Scripts in the Footer
*
* Automatically move JavaScript code to page footer, speeding up page loading time.
*/
function footer_enqueue_scripts() {
remove_action('wp_head', 'wp_print_scripts');
remove_action('wp_head', 'wp_print_head_scripts', 9);
remove_action('wp_head', 'wp_enqueue_scripts', 1);
@Woorg
Woorg / atom
Last active October 26, 2018 15:52
automatic update by http://atom.io/packages/sync-settings
d
$(function(){
new VpsCalculator({
element: $('.calculator'),
order: $('.order-send'),
orderSuccess: $('.order-success')
});
});
@Woorg
Woorg / include bemto.jade into project
Created June 8, 2016 05:45
include bemto.jade into project
include ../../node_modules/bemto.jade/bemto
// Reset
// ==========================================================================
// Reset default styles.
* // @stylint ignore
margin 0
padding 0
font inherit
-webkit-box-sizing border-box
@Woorg
Woorg / set of stylus mixins
Last active June 24, 2016 01:39
Set of useful stylus mixins
// Mixins.
$helvetica = 'Helvetica', Helvetica Neue, Arial, sans-serif;
$helvetica-bold = 'Helvetica Bold', Helvetica Neue, Arial, sans-serif;
$helvetica-light = 'Helvetica Light', Helvetica Neue, Arial, sans-serif;
$calibri = 'Calibri', Candara, Segoe, Segoe UI, Optima, Arial, sans-serif;
placeholder()
if selector() == "&"
error( "placeholder() must be called from a ruleset!" )
@Woorg
Woorg / pix to rem mixin
Created March 20, 2016 01:38
pix to rem mixin
set-font-size(value) {
font-size: value; /* add PX (or original value) as backup */
if (value is inherit) {
/* do nothing, "inherit" has no unit */
} else {
font-size: remify(value);
}
}