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
package main | |
import "net/http" | |
func main() { | |
panic(http.ListenAndServe(":8080", http.FileServer(http.Dir("/File/Folder/Path")))) | |
} |
require "sinatra" | |
require "sinatra/reloader" | |
require "redis-store" | |
require 'redis-rack' | |
class ApplicationController < Sinatra::Base | |
configure :development do | |
register Sinatra::Reloader | |
end | |
sudo su - | |
# stuff we need to build from source | |
apt-get install libpcre3-dev build-essential libssl-dev | |
# get the nginx source | |
cd /opt/ | |
wget http://nginx.org/download/nginx-0.8.54.tar.gz | |
tar -zxvf nginx* | |
# we'll put the source for nginx modules in here |
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
#import <CommonCrypto/CommonDigest.h> | |
-(NSString*) sha1:(NSString*)input | |
{ | |
const char *cstr = [input cStringUsingEncoding:NSUTF8StringEncoding]; | |
NSData *data = [NSData dataWithBytes:cstr length:input.length]; | |
uint8_t digest[CC_SHA1_DIGEST_LENGTH]; | |
CC_SHA1(data.bytes, data.length, digest); |
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/bash | |
DIR="$HOME/Desktop" | |
FILE="$DIR/.hidden_icons" | |
# hide icons for Windows VM | |
always_hide() { | |
chflags hidden $DIR/\$RECYCLE.BIN | |
chflags hidden $DIR/desktop.ini | |
} |
- What projects are you working on at home? | |
- What beta toys are you playing with? | |
- What source control do you use? | |
- How do you approach your documentation? | |
- Which tools do you use for keeping track of requirements? | |
- Give me an example of a project that completely failed? | |
- How do you design scalable applications? | |
- What language to you prefer for writing complex algorithms? | |
- Which tools are needed for testing the quality of your code? | |
- How to debug a web application from client, frontend, to backend? |
// This script will boot app.js with the number of workers | |
// specified in WORKER_COUNT. | |
// | |
// The master will respond to SIGHUP, which will trigger | |
// restarting all the workers and reloading the app. | |
var cluster = require('cluster'); | |
var workerCount = process.env.WORKER_COUNT || 2; | |
// Defines what each worker needs to run |
SET @start_key=1005069; | |
SET @paging_size = 20; | |
SELECT * FROM ( | |
SELECT | |
(@row_num:=@row_num + 1) AS `@row_num`, | |
(@row_num_in_page:=CASE | |
WHEN f.id = @start_key THEN 0 | |
WHEN @row_num_in_page>=0 THEN @row_num_in_page+1 | |
ELSE -1 |