Skip to content

Instantly share code, notes, and snippets.

@samsoir
samsoir / vhost.conf
Created November 6, 2009 11:22 — forked from shadowhand/vhost.conf
nginx 1.0.0 config for Debian 6 (Squeeze)
# default server
server {
listen 80;
server_name dev.kohana.framework;
root /mnt/hgfs/Projects/kohana;
access_log /var/log/nginx/dev.kohana.framework.access.log;
error_log /var/log/nginx/dev.kohana.framework.error.log;
location / {
@morganp
morganp / .bashrc
Created June 29, 2010 13:17 — forked from justintv/.bashrc
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer!
PS1='\[\033[01;32m\]\h \[\033[01;34m\]\W' #\$ \[\033[00m\]'
PS1=$PS1"\$(git branch 2>/dev/null | grep '^*' | colrm 1 2 | xargs -I {} echo ' (\[\033[01;31m\]'{}'\[\033[01;34m\])')"
export PS1=$PS1" \$ \[\033[00m\]"
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty!
# host ~/code/web (beta_directory) $ git checkout master
@karmi
karmi / ElasticSearch.org.Website.Search.FieldNotes.markdown
Created April 8, 2011 17:15
Field notes gathered during installing and configuring ElasticSearch for http://elasticsearch.org

ElasticSearch.org Website Search: Field Notes

These are field notes gathered during installation of website search facility for the ElasticSearch website.

You may re-use it to put a similar system in place.

The following assumes:

@loonies
loonies / .htaccess
Last active August 28, 2018 05:45
Kohana .htaccess
# Turn on URL rewriting
RewriteEngine On
# Installation directory
RewriteBase /
# Protect hidden files from being viewed
<Files .*>
Order Deny,Allow
Deny From All
@loonies
loonies / security.php
Created July 21, 2011 10:09
Kohana CSRF validation rule
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Extension of Kohana_Security class
*
* @package Misc
* @category Security
* @author Miodrag Tokić <mtokic@gmail.com>
* @copyright (c) 2011, Miodrag Tokić
*/
class Security extends Kohana_Security {
@lrvick
lrvick / flask_geventwebsocket_example.py
Created September 1, 2011 07:17
Simple Websocket echo client/server with Flask and gevent / gevent-websocket
from geventwebsocket.handler import WebSocketHandler
from gevent.pywsgi import WSGIServer
from flask import Flask, request, render_template
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
#!/bin/bash
while read oldish newish ref; do
branch=$(echo "$ref" | cut -d"/" -f3-)
done
case "$branch" in
"live")
git --work-tree=/var/www/dylanstestserver.com/ checkout -f $branch
echo 'Changes pushed live.'
;;
esac
@shadowhand
shadowhand / .gitconfig
Created December 15, 2011 20:33
Complex Git Aliases
[alias]
co = checkout
st = status
ci = commit
rb = rebase
rank = shortlog -sn --no-merges
amend = commit --amend -C HEAD
vr = !sh -c \"git svn fetch && git svn rebase\"
vc = !sh -c \"git vr && git svn dcommit\"
ex = !sh -c \"git checkout-index -a -f --prefix=$1\"
@rcullito
rcullito / gist:cd4513766e112387b9c8
Created May 6, 2014 01:51
ElasticSearch Fuzzy Query, Favor Exact Matches
{
"query": {
"bool": {
"should": [
{
"match": {
"_all": search_term
}
},
{