Skip to content

Instantly share code, notes, and snippets.

@juil
juil / .gitignore
Created March 2, 2018 23:34 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@juil
juil / gist:1680141
Created January 26, 2012 01:02 — forked from fennb/gist:1283573
nginx microcaching config example
# 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)
package com.juilyoon.booklook;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.os.AsyncTask;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
@juil
juil / cup76_community
Created January 10, 2014 23:27
Experiments in Community Building -Karen Unland/Brittney LeBlanc The unedited notes
CUP 76 | Community Building
---
Karen Unland (Capital Ideas)
Sam Brook’s boss
Brittney LeBlanc (gastropost)
news radio
---
being a part of the community
The Mission:
#!/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
@juil
juil / gist:2127754
Created March 19, 2012 22:37 — forked from dhh/gist:1975644
attr_accessible fix
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
@juil
juil / gist:1679989
Created January 26, 2012 00:26 — forked from fennb/gist:1124535
node.js proxy server in 20 lines of JS (via http://www.catonmat.net/http-proxy-in-nodejs/)
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() {
@juil
juil / gist:1680142
Created January 26, 2012 01:03 — forked from fennb/gist:1283999
Benchmark, wordpress + apache2 + php-fpm + apc / EC2 small
$ 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
@juil
juil / gist:1680170
Created January 26, 2012 01:04 — forked from fennb/gist:1284002
nginx microcaching, concurrency 500
$ 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