Skip to content

Instantly share code, notes, and snippets.

@quilime
quilime / application mod rewrite .htaccess
Created November 29, 2010 07:09
.htaccess for web applications
# Pass existing files, symlinks, directories through like normal
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
# Pass everything else to the application
RewriteRule ^.*$ application.php [NC,L]
@quilime
quilime / quasi.glsl
Last active November 21, 2015 22:33
// http://glslsandbox.com/e#29006.1
#ifdef GL_ES
precision mediump float;
#endif
// modified by @hintz
// further modded by @quilime
# .SyncIgnore is a UTF-8 encoded .txt file that helps you specify single files, paths and rules
# for ignoring during the synchronization job. It supports "?" and "*" wildcard symbols.
#
#
# OS generated files #
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
# StreamsList is a UTF-8 encoded .txt file that helps you specify alternate streams,
# xattrs and resource forks white list. It supports "?" and "*" wildcard symbols.
#
#
com.apple.FinderInfo
com.apple.metadata:_kMDItemUserTags
com.apple.metadata:kMDItemFinderComment
@quilime
quilime / btsync init.d
Created November 29, 2015 21:55
init.d for btsync
#!/bin/sh
### BEGIN INIT INFO
# Provides: btsync
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Should-Start: network-manager
# Should-Stop: network-manager
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
sshfs -o reconnect -o volname=mount-name -o IdentityFile=~/.ssh/id_rsa user@remoteserver:/dir/to/mount /home/user/sshfs/mountpoint
@quilime
quilime / stars.py
Created April 18, 2013 03:40
random stars in the console
#!/usr/bin/python
import random
rows = 20
cols = 80
num_stars = 100
rand_stars = []
while (len(rand_stars) < num_stars):
@quilime
quilime / htmlwordcount.py
Last active December 16, 2015 10:58
Count words from html
import nltk
import string
from urllib import urlopen
from itertools import imap
url = "http://google.com"
html = urlopen(url).read()
text = nltk.clean_html(html)
text_noPunc = text.translate(string.maketrans("",""), string.punctuation)
words = text_noPunc.split()
@quilime
quilime / triangle.frag
Last active December 22, 2015 03:09
GLSL Triangle function
// via "Einstienstien" - by Dave Hoskins, on Shadertoy
// http://glsl.heroku.com/e#10662.0
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 resolution;
float col = 0.0; // Start black.