Skip to content

Instantly share code, notes, and snippets.

@wzjmit
wzjmit / web-servers.md
Created May 30, 2018 05:51 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
#!/usr/bin/python
# coding: UTF-8
import MySQLdb
import signal, os, sys
workers = {}
END_SIGNAL = "\n"
def connect():
@wzjmit
wzjmit / 1.UIStoryboardSegueFromRight.swift
Created May 24, 2017 16:26 — forked from marcboeren/1.UIStoryboardSegueFromRight.swift
Segue from Right (Slide the next controllers view in from right to left (and back))
import UIKit
class UIStoryboardSegueFromRight: UIStoryboardSegue {
override func perform()
{
let src = self.sourceViewController as UIViewController
let dst = self.destinationViewController as UIViewController
src.view.superview?.insertSubview(dst.view, aboveSubview: src.view)
@wzjmit
wzjmit / homebrew_multiple_mysql_versions.md
Created November 15, 2016 05:45 — forked from benlinton/multiple_mysql_versions_for_development.md
Multiple MySQL Versions with Homebrew

Multiple MySQL Versions with Homebrew

For homebrew version 0.9.5.

brew -v # => Homebrew 0.9.5

Install the current version of mysql.

# Install current mysql version

brew install mysql