This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
#!/bin/sh | |
SPACE="SERVER$(spacefinder | sed 's/Current Space ID: //')" | |
mvim --serverlist | grep $SPACE | |
if [ $? -eq 1 ] | |
then | |
mvim --servername $SPACE $* | |
else | |
mvim --servername $SPACE --remote $* | |
fi |
class PostsController < ActionController::Base | |
def create | |
Post.create(post_params) | |
end | |
def update | |
Post.find(params[:id]).update_attributes!(post_params) | |
end | |
private |
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
$ ab -n 10000 -c 500 http://wp-demo.local/ | |
Server Software: nginx/0.8.54 | |
Server Hostname: wp-demo.local | |
Server Port: 80 | |
Document Path: / | |
Document Length: 5728 bytes | |
Concurrency Level: 500 |
$ ab -n 200 -c 4 http://wp-demo.local:8080/ | |
Server Software: Apache/2.2.17 | |
Server Hostname: wp-demo.local | |
Server Port: 8080 | |
Document Path: / | |
Document Length: 5726 bytes | |
Concurrency Level: 4 |
# Set cache dir | |
proxy_cache_path /var/cache/nginx levels=1:2 | |
keys_zone=microcache:5m max_size=1000m; | |
# Virtualhost/server configuration | |
server { | |
listen 80; | |
server_name yourhost.domain.com; | |
# Define cached location (may not be whole site) |
var http = require('http'); | |
http.createServer(function(request, response) { | |
var proxy = http.createClient(80, request.headers['host']) | |
var proxy_request = proxy.request(request.method, request.url, request.headers); | |
proxy_request.addListener('response', function (proxy_response) { | |
proxy_response.addListener('data', function(chunk) { | |
response.write(chunk, 'binary'); | |
}); | |
proxy_response.addListener('end', function() { |
#!/bin/bash | |
# | |
# Watch current directory (recursively) for file changes, and execute | |
# a command when a file or directory is created, modified or deleted. | |
# | |
# Written by: Senko Rasic <[email protected]> | |
# | |
# Requires Linux, bash and inotifywait (from inotify-tools package). | |
# | |
# To avoid executing the command multiple times when a sequence of |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer