Skip to content

Instantly share code, notes, and snippets.

View hameedullah's full-sized avatar
😄

Hameedullah Khan hameedullah

😄
View GitHub Profile
@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
@renatolfc
renatolfc / android-client.ovpn
Created December 28, 2014 18:59
A sample OpenVPN client configuration file in the unified format
client
dev tun
remote example.com
resolv-retry infinite
nobind
persist-key
persist-tun
ca [inline]
cert [inline]
key [inline]
@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@ghaering
ghaering / dbg-cloud-init
Created May 27, 2014 07:22
Re-run cloud init scripts on Ubuntu 12.04 (AWS)
#!/bin/sh
rm -rf /var/lib/cloud/sem/* /var/lib/cloud/instance /var/lib/cloud/instances/*
cloud-init start 2>&1 > /dev/null
cloud-init-cfg all final
@mikeal
mikeal / gist:5986692
Created July 12, 2013 18:31
List all browserified files sorted by size.
ls -lrt $(node node_modules/.bin/browserify --list app/app.js) | awk '{print $5 " " $9}' | sort -n
@mikeschinkel
mikeschinkel / aeromaxx-parse-request.php
Created August 19, 2012 00:16
WordPress URLs for 1 taxonomy on 2 different custom post types
<?php
/**
* Answering: http://lists.automattic.com/pipermail/wp-hackers/2012-August/044119.html
* By: Mike Schinkel - http://about.me/mikeschinkel
*/
add_action( 'parse_request', 'aeromaxx_parse_request' );
function aeromaxx_parse_request( $wp ) {
if ( preg_match( '#^/(draw-results|ball-statistics)/game/([^/]+)/#', $_SERVER['REQUEST_URI'], $matches ) ) {
$wp->query_vars = array(
'post_type' => $matches[1], // Assumes your post types are registered with same name as your URL slugs
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 18, 2024 11:00
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@taavi
taavi / gist:2757885
Created May 20, 2012 12:16
Function overloading in Python
#!/usr/bin/python
import inspect
from functools import wraps
from collections import defaultdict
# This time, we'll avoid using a class to hold the namespace. We'll just use
# the class that the functions are being defined in.
# AS A BONUS
# This means that it works for module-level functions, not just methods!
@hameedullah
hameedullah / suppress-test.php
Created November 18, 2011 08:24 — forked from mikeschinkel/suppress-test.php
Testing suppression of error using @sign
<?php
/*
TESTING:
http://programmers.stackexchange.com/questions/120378/is-error-suppression-acceptable-in-role-of-logic-mechanism/120386#120386
Elapsed Time[µseconds]
Check, Exists :
50000 - Check, Exists : 94718 (user), 342 (system)
EACH - Check, Exists : 1.89436E-6 (user), 6.84E-9 (system)
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
####################################
sudo apt-get update
sudo apt-get upgrade