Skip to content

Instantly share code, notes, and snippets.

View devrahul's full-sized avatar

Rahul devrahul

View GitHub Profile
const path = require('path'),
webpack = require('webpack'),
AssetsPlugin = require('assets-webpack-plugin'),
BrotliPlugin = require('brotli-webpack-plugin'),
HtmlWebpackPlugin = require('html-webpack-plugin'),
UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const isProd = process.env.NODE_ENV === 'production';
/**
@devrahul
devrahul / dispatcher.js
Created February 3, 2019 16:48 — forked from LeoAref/dispatcher.js
Simple event dispatcher implementation using JavaScript
export class Dispatcher {
constructor () {
this.events = {};
}
addListener (event, callback) {
// Check if the callback is not a function
if (typeof callback !== 'function') {
console.error(`The listener callback must be a function, the given type is ${typeof callback}`);
return false;
@devrahul
devrahul / media-query.css
Created August 30, 2018 07:47 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@devrahul
devrahul / spiderme.sh
Created February 11, 2017 18:36 — forked from joshkoenig/spiderme.sh
Spider-based Benchmarking with wget
#!/bin/sh
# Spiderme - quick and clean benchmarking for website performance on Pantheon.
#
# This script uses wget to "spider" your website to provide a good set of data
# on site performance. It will automatically bypass Pantheon's edge cache, and
# skip images, javascript, css, etc. It will also only spider links that are
# under the multidev environment you are spidering.
#
#
@devrahul
devrahul / spiderme.sh
Created February 11, 2017 18:36 — forked from joshkoenig/spiderme.sh
Spider-based Benchmarking with wget
#!/bin/sh
# Spiderme - quick and clean benchmarking for website performance on Pantheon.
#
# This script uses wget to "spider" your website to provide a good set of data
# on site performance. It will automatically bypass Pantheon's edge cache, and
# skip images, javascript, css, etc. It will also only spider links that are
# under the multidev environment you are spidering.
#
#
@devrahul
devrahul / t5-query-log.php
Created January 27, 2017 14:04 — forked from thefuxia/t5-query-log.php
T5 Log Queries
<?php
/**
* Plugin Name: T5 Log Queries
* Description: Writes all queries to '/query-log.sql'.
* Plugin URI: http://wordpress.stackexchange.com/a/70853/73
* Version: 2012.11.04
* Author: Thomas Scholz
* Author URI: http://toscho.de
* Licence: MIT
*/
@devrahul
devrahul / wordpress-create-user.php
Created January 29, 2016 04:50
Create a user in WordPress from a php page/script outside of the WordPress system.
<?php
// [wp insert user « WordPress Codex](http://codex.wordpress.org/Function_Reference/wp_insert_user)
require_once "wordpress/wp-load.php";
$user_info = array(
"user_pass" => "test123",
"user_login" => "username",
"user_nicename" => "username",
"user_email" => "email@example.com",