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
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 python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" |
#!/usr/bin/env bash | |
# List directories sorted by size, find largest directories | |
# Author: Quanlong <kyan.ql.he@gmail.com> | |
# 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 | |
# Copyright (c) 2014 Quanlong. All rights reserved. | |
# | |
# \author: Quanlong <quanlong.he@gmail.com> | |
import subprocess | |
import re | |
import optparse | |
import sys | |
import os |
// | |
// UITableView+ClearSelections.swift | |
// Cybertk | |
// | |
// Created by Quanlong He on 8/20/15. | |
// Copyright © 2015 Quanlong He. All rights reserved. | |
// | |
import Foundation |
NSNotificationCenter.defaultCenter().addObserverForName(UITextFieldTextDidChangeNotification, object: textField, queue: nil, usingBlock: { note in | |
print("UITextFieldTextDidChangeNotification") | |
}) |
sudo -i
and type in your Mac Administrator account password. sudo
gives you root level or administrator level privileges.dsconfigad -show
#!/usr/bin/env python | |
import shutil | |
import os | |
import glob | |
import json | |
import sys | |
def CreateXcassets(name): | |
# Cleanup siliently first. |
// | |
// UInt32+IPv4String.swift | |
// Cybertk | |
// | |
// Created by Quanlong He on 8/14/15. | |
// Copyright © 2015 Quanlong He. All rights reserved. | |
// | |
import Foundation |
require('chai').should() | |
Mocha = require 'mocha' | |
Test = Mocha.Test | |
Suite = Mocha.Suite | |
mocha = new Mocha | |
suite = Suite.create mocha.suite, 'I am a dynamic suite' | |
suite.addTest new Test 'I am a dynamic test', -> | |
true.should.equal true |