Skip to content

Instantly share code, notes, and snippets.

View shubhendusaurabh's full-sized avatar
🏠
Working from home

Shubhendu shubhendusaurabh

🏠
Working from home
View GitHub Profile
@shubhendusaurabh
shubhendusaurabh / wordpress.php
Created January 28, 2017 18:19
wordpress helpful functions
// Get Rid of WP Version Footprint Throughout Site
function ryu_remove_version() {
return '';
}
add_filter('the_generator', 'ryu_remove_version');
// Remove Footprints and Search Engine Confusion from wp_head Function
remove_action('wp_head', 'wlwmanifest_link');
remove_action('wp_head', 'rsd_link');
remove_action('wp_head', 'wp_generator');
@shubhendusaurabh
shubhendusaurabh / pg
Created June 27, 2015 18:20
Clean and import postgres
pg_dump -d top10songs -U shubhu --clean | pg_restore --verbose --clean --no-acl --no-owner -h localhost -U shubhu -d top10songs ../latest.dump
@shubhendusaurabh
shubhendusaurabh / synchronous
Created January 15, 2015 11:21
Synchronous
function synchronously(tasks){
var i, task, func,
promise = $.Deferred().resolve().promise(), //
makeRunner = function(func, args){ //
return function(){
return func.apply(null, args).promise();
};
};
for (i = 0; i < tasks.length; i++){
task = tasks[i];
@shubhendusaurabh
shubhendusaurabh / gist:0286d7059b5bfb971e02
Created January 12, 2015 11:42
A Replacement for the setTimeout Function
function wait(timeout){
var deferred = $.Deferred();
setTimeout(deferred.resolve, timeout);
return deferred.promise();
}
wait(500).done(function(){
console.log('Timeout fired!');
});