Skip to content

Instantly share code, notes, and snippets.

View webdevid's full-sized avatar
🎯
Focusing

dodi hidayatullah webdevid

🎯
Focusing
View GitHub Profile
@webdevid
webdevid / functions.php
Created November 8, 2017 04:38 — forked from WebEndevSnippets/functions.php
WordPress: Reduce Database Queries
Reduce database queries (http://www.catswhocode.com/blog/speeding-up-your-wordpress-blog-7-effective-solutions)
It is important to reduce unecessary queries to your database as each query take a few milliseconds to execute. First, you might want to know how many queries your blog execute in order to display a page. To do so, paste the code below in your functions.php file. Once done, just have a look to your site footer to know how many queries has been executed and how many time it took to completely load the page.
add_action( 'wp_footer', 'tcb_note_server_side_page_speed' );
function tcb_note_server_side_page_speed() {
date_default_timezone_set( get_option( 'timezone_string' ) );
$content = '[ ' . date( 'Y-m-d H:i:s T' ) . ' ] ';
$content .= 'Page created in ';
$content .= timer_stop( $display = 0, $precision = 2 );
$content .= ' seconds from ';
@webdevid
webdevid / Learning React Redux ES6 resources.md
Created October 26, 2017 00:08 — forked from tirams/Learning React Redux ES6 resources.md
Here are some resources I’ve used to learn react, redux and es6
@webdevid
webdevid / gulpfile.js
Created August 20, 2017 03:34 — forked from zellwk/gulpfile.js
Gulpfile-testing-phase
var gulp = require('gulp');
var sass = require('gulp-sass');
var plumber = require('gulp-plumber');
var notify = require('gulp-notify');
var browserSync = require('browser-sync');
var autoprefixer = require('gulp-autoprefixer');
var sourcemaps = require('gulp-sourcemaps');
var spritesmith = require('gulp.spritesmith');
var gulpIf = require('gulp-if');
var nunjucksRender = require('gulp-nunjucks-render');
@webdevid
webdevid / gulpfile.js
Last active August 19, 2017 14:24 — forked from zellwk/gulpfile.js
Gulpfile development-phase
var gulp = require('gulp');
var sass = require('gulp-sass');
var plumber = require('gulp-plumber');
var notify = require('gulp-notify');
var browserSync = require('browser-sync');
var autoprefixer = require('gulp-autoprefixer');
var sourcemaps = require('gulp-sourcemaps');
var spritesmith = require('gulp.spritesmith');
var gulpIf = require('gulp-if');
var nunjucksRender = require('gulp-nunjucks-render');
<?php
/**
* Plugin Name: Underscores.me Generator
* Description: Generates themes based on the _s theme.
*/
class Underscores_Generator_Plugin {
protected $theme;
/* ----------------------------------------------------------------------------------------------------
Super Form Reset
A couple of things to watch out for:
- IE8: If a text input doesn't have padding on all sides or none the text won't be centered.
- The default border sizes on text inputs in all UAs seem to be slightly different. You're better off using custom borders.
- You NEED to set the font-size and family on all form elements
- Search inputs need to have their appearance reset and the box-sizing set to content-box to match other UAs
@webdevid
webdevid / php-html-css-js-minifier.php
Created October 13, 2016 02:07 — forked from taufik-nurrohman/php-html-css-js-minifier.php
PHP Function to Minify HTML, CSS and JavaScript
<?php
/**
* ----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/engine/plug/converter.php`
* ----------------------------------------------------------------------------------------
*/
@webdevid
webdevid / sc-jp.html
Last active August 29, 2015 14:25 — forked from miduku/sc-jp.html
<!-- JSPLAYER -->
<div id="jquery_jplayer_1" class="jp-jplayer">
</div><!-- jquery_jplayer_1 -->
<div id="jp_container_1" class="jp-audio">
<div class="jp-type-playlist">
<div class="cover">
<a href="#"><img src="#.jpg" alt="#"></a>
<div class="jp-gui">
<div class="jp-interface">
// SmoothScroll for websites v1.2.1
// Licensed under the terms of the MIT license.
// People involved
// - Balazs Galambosi (maintainer)
// - Michael Herf (Pulse Algorithm)
(function(){
// Scroll Variables (tweakable)
<?php
/*
Plugin Name: Nav Menu Exporter and Importer
Description: Export and Import nav menus. Requires WordPress Importer plugin
Author: hissy, megumi themes
Version: 0.1
Text Domain: nav-menu-exporter-importer
License: GPL version 2 or later - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/