Skip to content

Instantly share code, notes, and snippets.

# found here:
# http://stackoverflow.com/questions/862173/how-to-download-a-file-using-python-in-a-smarter-way
#
import sys
import urllib2
from os.path import basename
from urlparse import urlsplit
def url2name(url):
#!/usr/bin/env bash
# file: ~/.virtualenvs/postmkvirtualenv
# This hook is run after a new virtualenv is activated.
# setup python interpretor and sitepackages
# for Sublime Text's SublimeCodeIntel plugin.
# codeintel looks in the root of any folder opened via `subl foldername`
# for foldername/.codeintel/config
# it also looks in ~/.codeintel/config

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...

@andreydelpozo2
andreydelpozo2 / gist:4077a72e96971e5bbcd3
Created September 14, 2015 21:09
fix brew in elCap
cd `brew --prefix`
git remote add origin https://github.com/mxcl/homebrew.git
git fetch origin
git reset --hard origin/master
@andreydelpozo2
andreydelpozo2 / foo.log
Created February 16, 2017 05:14 — forked from ibeex/foo.log
Flask logging example
A warning occurred (42 apples)
An error occurred
#include <stdexcept>
#include <cmath>
#include <vector>
#include <Windows.h>
#include <Psapi.h>
#include <detours.h>
#include <d3d9.h>
#include <d3dx9.h>
#define PI 3.14159F
#include <Windows.h>
#include <TlHelp32.h>
#include <Psapi.h>
int main()
{
const auto *exe = "GuiltyGearXrd.exe";
const auto *dll = "ggxrd_hitbox_overlay.dll";
const auto snap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);