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
@echo off | |
title GNDN | |
mode 65,25 | |
color 4F | |
echo. | |
echo GNDN SUBSYSTEM RECALIBRATION | |
echo _________________________________________________________________ | |
echo. | |
echo Level 1 Diagnostic |
In August 2007 a hacker found a way to expose the PHP source code on facebook.com. He retrieved two files and then emailed them to me, and I wrote about the issue:
http://techcrunch.com/2007/08/11/facebook-source-code-leaked/
It became a big deal:
http://www.techmeme.com/070812/p1#a070812p1
The two files are index.php (the homepage) and search.php (the search page)
# remove_CLI_tools.sh | |
# written by cocoanetics:http://www.cocoanetics.com/2012/07/you-dont-need-the-xcode-command-line-tools/ | |
# modified by yoneken | |
#!/bin/sh | |
RECEIPT_FILE1=/var/db/receipts/com.apple.pkg.DevSDK.bom | |
RECEIPT_PLIST1=/var/db/receipts/com.apple.pkg.DevSDK.plist | |
RECEIPT_FILE2=/var/db/receipts/com.apple.pkg.clang.bom | |
RECEIPT_PLIST2=/var/db/receipts/com.apple.pkg.clang.plist |
/* Skip Lists: A Probabilistic Alternative to Balanced Trees */ | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <limits.h> | |
#define SKIPLIST_MAX_LEVEL 6 | |
typedef struct snode { | |
int key; |
function mkdir_if_not_exist(dirpath) | |
if dirpath(end) ~= '/', dirpath = [dirpath '/']; end | |
if (exist(dirpath, 'dir') == 0), mkdir(dirpath); end | |
end |
// swap the keybindings for paste and paste_and_indent | |
{ "keys": ["super+v"], "command": "paste_and_indent" }, | |
{ "keys": ["super+shift+v"], "command": "paste" } |
<?php | |
# Algorithm found here: http://www.hackerfactor.com/blog/index.php?/archives/432-Looks-Like-It.html | |
$filename = 'image.jpg'; | |
list($width, $height) = getimagesize($filename); | |
$img = imagecreatefromjpeg($filename); | |
$new_img = imagecreatetruecolor(8, 8); |
# First install tmux | |
brew install tmux | |
# For mouse support (for switching panes and windows) | |
# Only needed if you are using Terminal.app (iTerm has mouse support) | |
Install http://www.culater.net/software/SIMBL/SIMBL.php | |
Then install https://bitheap.org/mouseterm/ | |
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |
#!/bin/sh | |
# Just copy and paste the lines below (all at once, it won't work line by line!) | |
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY! | |
function abort { | |
echo "$1" | |
exit 1 | |
} | |
set -e |