Skip to content

Instantly share code, notes, and snippets.


José Aguirre josejaguirre

View GitHub Profile
mtigas / gist:952344
Last active Sep 15, 2022
Mini tutorial for configuring client-side SSL certificates.
View gist:952344

Client-side SSL

For excessively paranoid client authentication.

Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

insin /
Created Dec 3, 2011 — forked from woods/
Set color bash prompt according to active virtualenv, git branch and return status of last command.
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
qiao / ip.js
Created Jan 17, 2012
Node.js get client IP address
View ip.js
// snippet taken from
function getClientIp(req) {
var ipAddress;
// The request may be forwarded from local web server.
var forwardedIpsStr = req.header('x-forwarded-for');
if (forwardedIpsStr) {
// 'x-forwarded-for' header may return multiple IP addresses in
// the format: "client IP, proxy 1 IP, proxy 2 IP" so take the
// the first one
var forwardedIps = forwardedIpsStr.split(',');
onpubcom / onpubcom_array_date_sort.js
Created Feb 8, 2012
How to Sort an Array of Dates with JavaScript
View onpubcom_array_date_sort.js
<script type="text/javascript">
// First let's create an array of JavaScript Date
// objects.
// More info about the Date class:
var dates = [
new Date(2010, 4, 10, 10, 07, 16),
new Date(2010, 4, 8, 9, 16, 09),
new Date(2010, 3, 30, 0, 15, 49),
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname
cam-gists / fgc.php
Created Jul 2, 2012
PHP: file_get_contents vs. cURL
View fgc.php
$html = file_get_contents("");
$context = stream_context_create(array(
"http" => array(
"method" => "POST",
"header" => "Content-Type: multipart/form-data; boundary=--foo\r\n",
"content" => "--foo\r\n"
. "Content-Disposition: form-data; name=\"myFile\"; filename=\"image.jpg\"\r\n"
. "Content-Type: image/jpeg\r\n\r\n"
sofa420 /
Created Jul 30, 2012 — forked from kmpm/
Fabric deployment of Node.js on Ubuntu
from __future__ import with_statement
from fabric.api import env
from fabric.api import *
from fabric.contrib.console import confirm
from fabric.contrib.project import upload_project
import ubuntu
import protobuf
renyi /
Created Aug 18, 2012
Simple Geo model for Django
from geopy import units, distance
from mezzanine.core.managers import CurrentSiteManager
class GeoManager(CurrentSiteManager):
def near(self, latitude=None, longitude=None, distance_range=30):
queryset = super(GeoManager, self).get_query_set()
if not (latitude and longitude and distance_range):
return queryset.none()
iros /
Created Aug 22, 2012
Documenting your REST API


<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

setola / functions.php
Last active Sep 25, 2020 — forked from johnmegahan/functions.php
Extended Walker class for use with the Twitter Bootstrap toolkit Dropdown n-levels menus in Wordpress.
View functions.php
* Extended Walker class for use with the
* Twitter Bootstrap toolkit Dropdown menus in Wordpress.
* Edited to support n-levels submenu.
* @author johnmegahan, Emanuele 'Tex' Tessore
* @license CC BY 4.0
class BootstrapNavMenuWalker extends Walker_Nav_Menu {