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.
$ python -m SimpleHTTPServer 8000
#!/usr/bin/env bash | |
# List directories sorted by size, find largest directories | |
# Author: Quanlong <[email protected]> | |
# Version: v20170601 | |
# | |
# Upgrade with curl -o https://gist.githubusercontent.com/cybertk/4b02531350c09235f3e2d00fdbb3bbcd/raw/36ebae4da87ea7fe504ba58c32c81060c62e6b8d/largest | |
list_dir_by_size() { | |
declare dir="$1" |
#!/usr/bin/env python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" |
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.
$ python -m SimpleHTTPServer 8000
#!/bin/sh | |
O=mp4s | |
videos=$(find ./videos -iname "*.avi") | |
for f in $videos; do | |
o="$O/$(basename ${f%%.avi}).mp4" | |
if [[ ! -f "$o" ]]; then | |
cmd="HandBrakeCLI -i "$f" -o "$O/$(basename ${f%%.avi}).mp4"" |
{url:'stun:stun01.sipphone.com'}, | |
{url:'stun:stun.ekiga.net'}, | |
{url:'stun:stun.fwdnet.net'}, | |
{url:'stun:stun.ideasip.com'}, | |
{url:'stun:stun.iptel.org'}, | |
{url:'stun:stun.rixtelecom.se'}, | |
{url:'stun:stun.schlund.de'}, | |
{url:'stun:stun.l.google.com:19302'}, | |
{url:'stun:stun1.l.google.com:19302'}, | |
{url:'stun:stun2.l.google.com:19302'}, |
sudo -i
and type in your Mac Administrator account password. sudo
gives you root level or administrator level privileges.dsconfigad -show
NSNotificationCenter.defaultCenter().addObserverForName(UITextFieldTextDidChangeNotification, object: textField, queue: nil, usingBlock: { note in | |
print("UITextFieldTextDidChangeNotification") | |
}) |
// | |
// UITableView+ClearSelections.swift | |
// Cybertk | |
// | |
// Created by Quanlong He on 8/20/15. | |
// Copyright © 2015 Quanlong He. All rights reserved. | |
// | |
import Foundation |
// See http://stackoverflow.com/questions/3124080/app-store-link-for-rate-review-this-app | |
func jumpToAppStore(appID: String) { | |
let url = "itms-apps://itunes.apple.com/app/id\(appID)" | |
UIApplication.sharedApplication().openURL(NSURL(string: url)!) | |
} |
// | |
// UInt32+IPv4String.swift | |
// Cybertk | |
// | |
// Created by Quanlong He on 8/14/15. | |
// Copyright © 2015 Quanlong He. All rights reserved. | |
// | |
import Foundation |