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)
@-moz-document regexp("https://[^./]*\\.slack\\.com/(?!pricing)(?!security).*") { body { background: #3e313c; color: #f0d9ed; }
a { color: #a3839f; }
a:link, a:visited { color: #a3839f; }
a:hover, a:active, a:focus { color: #d4bbd1; }
hr { border-bottom: 1px solid #4a3b49; border-top: 1px solid #3e313c; }
h1, h2, h3, h4 { color: #f0d9ed; }
h1 a { color: #f0d9ed; }
h1 a:active, h1 a:hover, h1 a:link, h1 a:visited { color: #f0d9ed; }
.bordered { border: 1px solid #4d394b; }
.top_border { border-top: 1px solid #4d394b; }
@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