Peer-reviewed code snippets that anyone can edit
follow refactory on twitter
blog
feedback
A wiki for useful code snippets
Bugs? Suggestions?
38-107-191-111
create/login
options
RECENT
STUBS/REQUESTS
STARRED
ACTIVITY
ADD
recent snippets
haskell
array
choice
choose
element
list
pick
random
select
209-22-88-90
Select a random element from a list
permalink
related
edit
fork
history
python
gobject
idle
singleton
methods
list
thread
khertan
Gobject idle_add Singleton
permalink
related
edit
fork
4d
2003
4d
open
uri
url
92-142-227-69
Open URI with app set in windows system preferences instead of IE
permalink
related
edit
fork
history
vala
clutter
mash
lethalman
Using Mash with Vala
permalink
related
edit
fork
python
generator
password
python
pheven
password generator
permalink
related
edit
fork
history
php
php5
symfony
environment
68-0-159-130
Symfony - Get current working environment (prod, dev, etc.)
permalink
related
edit
fork
history
vala
monads
lethalman
Vala Monads
permalink
related
edit
fork
history
php
symfony
ajax
json
sfresponse
aaron
Set appropriate JSON headers for syfmony response
permalink
related
edit
fork
history
rebol
time
date
diff
difference
75-101-29-32
Compute time and date differences
permalink
related
edit
fork
rebol
file
search
replace
75-101-29-32
Search and replace specific text in a file
permalink
related
edit
fork
rebol
markup
html
xml
tags
75-101-29-32
Split HTML tags from content
permalink
related
edit
fork
visualbasic
vba
presentation
powerpoint
vba
slides
text
language
setting
Alpha
Change PowerPoint Presentation language for each slide and object
permalink
related
edit
fork
php
php5
symfony
country
form
widget
aaron
World country select/dropdown form widget
permalink
related
edit
fork
php
checkserverstatus
php
88-251-143-190
Check Server Status with PHP
permalink
related
edit
fork
history
javascript
jquery
check
checkbox
jquery
selectall
jomanlk
Easy SelectAll for Checkboxes
permalink
related
edit
fork
history
1
2
3
4
5
6
7
8
9
10
11
12
...
22
23
next
public snippets
This is a community-maintained collection of reusable code snippets.
Contribute something
without logging in, or improve existing contributions. All code is dedicated to the public domain unless otherwise specified.
stats
/
top contributers
Languages
highlight
sort:
alpha
/
pop
show:
top
/
all
4d
+
actionscript
+
actionscript3
+
apl
+
assembly
+
awk
+
bash
+
bat
+
batch
+
brainfuck
+
c
+
cake
+
cakephp
+
cmd
+
cocoa
+
commonlisp
+
cpp
+
csharp
+
css
+
curl
+
delphi
+
ecmascript
+
ecmascript5
+
elisp
+
erlang
+
fortran
+
haskell
+
html
+
java
+
javascript
+
javascript16
+
javascript17
+
javascript18
+
jquery
+
js
+
ksh
+
linux
+
lisp
+
lua
+
modula-3
+
mysql
+
net
+
obj-c
+
octave
+
perl
+
php
+
php4
+
php5
+
powershell
+
propel
+
python
+
r
+
rebol
+
regexp
+
ruby
+
scheme
+
sed
+
sh
+
shell
+
smalltalk
+
svn
+
svn15
+
swing
+
symfony
+
symfony12
+
tcl
+
uikit
+
vala
+
vb
+
vb60
+
vba
+
vbscript
+
vim
+
visualbasic
+
z80
+
Keywords
highlight
sort:
alpha
/
pop
show:
top
/
all
2003
+
4d
+
abstractdatatype
+
accessors
+
accounts
+
activedirectory
+
ad
+
admin
+
administrator
+
afx_ext_class
+
ajax
+
alphabetsequence
+
anchor
+
anonymous
+
apache
+
apng
+
arithmetic
+
array
+
array-generic
+
arrays
+
asm
+
aspnet
+
attributes
+
authenticate
+
authentication
+
auto-login
+
automaticdifferentiation
+
awt
+
backend
+
backup
+
base
+
base36
+
bash
+
bind
+
bitpacking
+
blocktext
+
boolean
+
border-radius
+
braches
+
browser
+
bufferedreader
+
bullets
+
bzip2
+
c
+
calculator
+
capabilities
+
centos
+
char
+
check
+
checkbox
+
checkrole
+
checkserverstatus
+
choice
+
choose
+
class
+
clean
+
clutter
+
cmd
+
cocoa
+
comments
+
comparing
+
condition
+
conditional
+
config
+
confirm
+
connection
+
connectioninfo
+
console
+
continuation
+
continuations
+
control
+
controller
+
controlstructure
+
conversion
+
convert
+
copy
+
core
+
count
+
country
+
cout
+
create
+
creditcard
+
criteria
+
csh
+
csource
+
css
+
csv
+
currency
+
daemon
+
dashboard
+
database
+
databases
+
databinding
+
date
+
dateformat
+
datetime
+
day
+
deb
+
debian
+
debug
+
debugging
+
decorator
+
decreasing
+
delay
+
delete
+
derivative
+
destructorsc
+
dialog
+
dictionary
+
diff
+
difference
+
directory
+
disk
+
dns
+
documentation
+
dom
+
domain
+
download
+
dpkg
+
dribble
+
dump
+
duplicate
+
e4x
+
each
+
element
+
email
+
enum
+
environment
+
epoch
+
errors
+
event
+
eventdispatcher
+
eventlistener
+
eventtarget
+
evil
+
example
+
excerpt
+
exchange
+
export
+
extension
+
extensions
+
factorial
+
factorization
+
factory
+
fft
+
fibonacci
+
file
+
filename
+
filereader
+
files
+
filesystem
+
filter
+
find
+
firebug
+
flac
+
folder
+
folders
+
force
+
foreach
+
fork
+
form
+
formatmoney
+
forms
+
fortune
+
forward
+
frame
+
frames
+
ft12
+
function
+
functional
+
functions
+
gcc
+
gcd
+
general
+
generator
+
generic
+
generqator
+
get
+
getters
+
gis
+
gmp
+
gmt
+
go
+
gobject
+
google
+
goto
+
growl
+
gui
+
gvim
+
gzip
+
hack
+
hanoi
+
hashtable
+
haystack
+
header
+
headers
+
heat
+
helloworld
+
heredoc
+
hex
+
hibernate
+
higher-order-function
+
href
+
html
+
html5
+
htmlcollection
+
http
+
hyperlink
+
hypotenuse
+
id
+
idle
+
ie
+
ie8
+
ifelse
+
iffalse
+
iftrue
+
image
+
images
+
import
+
increasing
+
indentation
+
infix
+
ini
+
inject
+
int
+
integer
+
integration
+
interface
+
internet
+
introduction
+
io
+
iostream
+
ip
+
iphone
+
irc
+
is_admin_user
+
iterator
+
java
+
javadoc
+
javax
+
jetpack
+
jquery
+
json
+
karma
+
kill
+
language
+
layout
+
lazy-evaluation
+
libnotify-bin
+
linkedlist
+
linq
+
linux
+
list
+
listprocessing
+
lists
+
live
+
load
+
localtime
+
locate
+
location
+
log
+
logged-onuser
+
login
+
logon
+
lsof
+
macrology
+
macros
+
markup
+
mash
+
math
+
mbr
+
md5
+
memoization
+
memory
+
merge
+
merging
+
mersenne
+
meta
+
metaprogramming
+
methods
+
mfc
+
min-height
+
mixin
+
monads
+
monitor
+
movieclip
+
mp3
+
mythryl
+
n-queens
+
namespaces
+
nan
+
needle
+
nemesis
+
network
+
newline
+
nodelist
+
non-recursive
+
notation
+
notifications
+
notify-osd
+
nsstring
+
number
+
numbers
+
numerical
+
obj-c
+
object
+
objectprototypetostring
+
objects
+
offset
+
okfail
+
oop
+
opacity
+
open
+
opengl
+
option
+
org
+
output
+
packages
+
palindrome
+
parse
+
parsec
+
parser
+
parsing
+
password
+
perldns
+
php
+
pick
+
ping
+
pipe
+
plugin
+
port
+
post
+
powerpoint
+
predicate
+
prefix
+
presentation
+
primalitytest
+
primefactorization
+
primenumbergeneration
+
primenumbers
+
primes
+
probability
+
process
+
processes
+
processing
+
profiling
+
progress
+
project-euler
+
propel
+
properties
+
property
+
prototypal
+
prototype
+
proxy
+
python
+
qt4
+
query
+
quote
+
random
+
rationalnumbers
+
readfilefilereader
+
recursion
+
reddit
+
redirect
+
regex
+
regexp
+
regular-expression
+
reintegrate
+
remote
+
remove
+
rename
+
replace
+
request
+
reset
+
role
+
root
+
round
+
routing
+
rtf
+
runtime
+
scanner
+
search
+
search-pattern
+
select
+
selectall
+
selectors
+
seo
+
sequence
+
server
+
setters
+
setting
+
sfresponse
+
sh
+
shares
+
shell
+
shuffle
+
singleton
+
size
+
slides
+
smtp
+
socket
+
softlink
+
solaris
+
solr
+
sort
+
spaces
+
spoof
+
spring
+
sql
+
static
+
statistics
+
storedprocedures
+
stream
+
string
+
strings
+
stringsreverse
+
stringutils
+
subdirectories
+
substring
+
sum
+
svn
+
swing
+
symbol
+
syntax
+
tables
+
tagbody
+
tags
+
tak
+
tar
+
tasks
+
tcp
+
tdistribution
+
telemechanics
+
template
+
templatehelper
+
templates
+
templating
+
terminal
+
ternary
+
text
+
textcontent
+
thread
+
thumbnail
+
ti-85
+
time
+
timedelta
+
times
+
timezone
+
to
+
tokenize
+
tostring
+
transfer
+
tree
+
triangle
+
trick
+
trigonometry
+
trim
+
ubuntu
+
unique
+
unix
+
unorthodox
+
unwatch
+
uri
+
url
+
user
+
utility
+
uuid
+
validation
+
variable
+
vba
+
watch
+
web
+
webserver
+
webworker
+
whilefalse
+
whiletrue
+
whitespace
+
widget
+
widgets
+
windows
+
wordpress
+
words
+
writermonad
+
x86
+
xargs
+
xcode
+
xev
+
xml
+
xmllist
+
zen
+
zshell
+