Skip to content

Instantly share code, notes, and snippets.

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

Emran Ahmed EmranAhmed

🏠
Working from home
View GitHub Profile
@EmranAhmed
EmranAhmed / array.php
Last active March 8, 2017 17:04 — forked from igorbenic/array.php
How to use the Starter Content in your WordPress Theme WP Starter Content, Demo contents
<?php
add_theme_support( 'starter-content', array(
// Content Section for Widgets
'widgets' => array(
// Sidebar
'sidebar-1' => array(
// Widget ID
'my_text' => array(
// Widget $id -> set when creating a Widget Class
@EmranAhmed
EmranAhmed / cookies.js
Last active December 23, 2016 09:14 — forked from CrocoDillon/cookies.js
Export your awesome module using AMD, CommonJS, Node.js or just as global.
/*
* Inspiration (well… copy pasting more or less) from:
* https://github.com/ScottHamper/Cookies/blob/0.3.1/src/cookies.js#L127-L140
*
* Thanks Scott!
*/
(function (global) {
'use strict';
var MyModule = function () {
@EmranAhmed
EmranAhmed / Slimdown.md
Created May 12, 2016 09:36 — forked from jbroadway/Slimdown.md
Slimdown - A simple regex-based Markdown parser.

Slimdown

A very basic regex-based Markdown parser. Supports the following elements (and can be extended via Slimdown::add_rule()):

  • Headers
  • Links
  • Bold
  • Emphasis
  • Deletions
@EmranAhmed
EmranAhmed / nginxproxy.md
Created May 9, 2016 10:47 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@EmranAhmed
EmranAhmed / ngxdis
Last active August 29, 2015 14:27 — forked from fideloper/ngxdis
Nginx scripts for enable and disabling a site. This will create or destroy a symlink between a real config file in /etc/nginx/sites-available and a symlink in /etc/nginx/sites-enabled.
#!/usr/bin/env bash
if [ $EUID -ne 0 ]; then
echo "You must be root: \"sudo ngxdis\""
exit 1
fi
# -z str: Returns True if the length of str is equal to zero.
if [ -z "$1" ]; then
echo "Please choose a site."
@EmranAhmed
EmranAhmed / california_nad83_zones_min.geojson
Last active August 29, 2015 14:27 — forked from zross/california_nad83_zones_min.geojson
Using geojson with Google Maps API
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@EmranAhmed
EmranAhmed / zsh.md
Last active September 7, 2015 07:38 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu, zshell ubuntu, ohmyzsh ubuntu
@EmranAhmed
EmranAhmed / elixir-custom-tasks.js
Last active August 29, 2015 14:26 — forked from kepek/elixir-custom-tasks.js
Laravel 4 - Gulp / Elixir + Custom Tasks
var elixir = require('laravel-elixir');
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var minify = require('gulp-minify-css');
var _ = require('underscore');
/*
|--------------------------------------------------------------------------
| Uglify Task
|--------------------------------------------------------------------------
@EmranAhmed
EmranAhmed / wp-comment-walker
Last active August 29, 2015 14:25 — forked from georgiecel/wp-comment-walker
Custom comment walker for HTML5 friendly WordPress comment and threaded replies. To be inserted in functions.php.
<?php
class comment_walker extends Walker_Comment {
var $tree_type = 'comment';
var $db_fields = array( 'parent' => 'comment_parent', 'id' => 'comment_ID' );
// constructor – wrapper for the comments list
function __construct() { ?>
<section class="comments-list">
onAfterDispatch
onAfterExecute
onAfterInitialise
onAfterRender
onAfterRespond
onAfterRoute
onAfterSessionStart
onBeforeCompileHead
onBeforeExecute
onBeforeIndex