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-81
create/login
options
RECENT
STUBS/REQUESTS
STARRED
ACTIVITY
ADD
related to
Array.make - transforms list-like data structures into native arrays
csharp
arrays
strings
words
aaron
Convert a string to a list/array of words in C#
permalink
related
edit
fork
history
bash
linux
sh
erezahala
XML parser for specific requested tag data value
permalink
related
edit
fork
history
javascript
functional
mgiovann
Functional Update of Structures
permalink
related
edit
fork
history
javascript
smalltalk
controlstructure
function
whilefalse
whiletrue
pseliger
Function.whileTrue - last one of Smalltalk inspired control structures.
permalink
related
edit
fork
history
ruby
arithmetic
array
inject
numbers
sum
66-92-65-45
Sum Numbers in an Array
permalink
related
edit
fork
history
javascript
javascript16
array
e4x
xml
xmllist
Eli
Array methods for XMLLists
permalink
related
edit
fork
history
ruby
array
philz.the.gecko
Easy Array Creation
permalink
related
edit
fork
javascript
objects
arrays
70-162-80-33
Loop over an object/array in Javascript
permalink
related
edit
fork
csharp
arrays
aaron
Initialize and assign values to an Array in C#
permalink
related
edit
fork
bash
directory
find
Zen SoSo
Directory list
permalink
related
edit
fork
haskell
primes
cdsmith
Short way to get a list of primes
permalink
related
edit
fork
history
haskell
list
random
shuffle
cdsmith
Randomly shuffle a list
permalink
related
edit
fork
history
bash
linux
file
70-162-80-33
List open files
permalink
related
edit
fork
history
mysql
database
70-162-80-33
List MySQL databases
permalink
related
edit
fork
haskell
count
list
property
189-123-216-113
Count the elements of a list that have a property
permalink
related
edit
fork
history
1
2
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
actionscript
+
actionscript3
+
apl
+
assembly
+
awk
+
bash
+
bat
+
batch
+
brainfuck
+
c
+
cmd
+
cocoa
+
commonlisp
+
cpp
+
csharp
+
css
+
curl
+
delphi
+
ecmascript
+
ecmascript5
+
elisp
+
erlang
+
fortran
+
haskell
+
html
+
java
+
javascript
+
javascript16
+
javascript17
+
javascript18
+
jquery
+
ksh
+
linux
+
lisp
+
lua
+
modula-3
+
mysql
+
net
+
obj-c
+
octave
+
perl
+
php
+
php4
+
php5
+
powershell
+
python
+
r
+
regexp
+
ruby
+
scheme
+
sed
+
sh
+
shell
+
smalltalk
+
svn
+
svn15
+
swing
+
symfony
+
symfony12
+
tcl
+
uikit
+
vala
+
vb
+
vb60
+
vbscript
+
vim
+
visualbasic
+
z80
+
Keywords
highlight
sort:
alpha
/
pop
show:
top
/
all
abstractdatatype
+
accessors
+
accounts
+
activedirectory
+
ad
+
administrator
+
afx_ext_class
+
alphabetsequence
+
anchor
+
anonymous
+
apache
+
apng
+
arithmetic
+
array
+
array-generic
+
arrays
+
asm
+
aspnet
+
attributes
+
authenticate
+
authentication
+
auto-login
+
automaticdifferentiation
+
backend
+
backup
+
base
+
base36
+
bash
+
bind
+
bitpacking
+
blocktext
+
boolean
+
border-radius
+
braches
+
browser
+
bufferedreader
+
bullets
+
bzip2
+
c
+
calculator
+
capabilities
+
centos
+
char
+
checkrole
+
class
+
clean
+
cmd
+
cocoa
+
comments
+
comparing
+
conditional
+
config
+
confirm
+
connection
+
connectioninfo
+
console
+
continuation
+
continuations
+
control
+
controller
+
controlstructure
+
conversion
+
convert
+
copy
+
core
+
count
+
cout
+
create
+
creditcard
+
csh
+
csource
+
csv
+
currency
+
daemon
+
dashboard
+
database
+
databases
+
databinding
+
date
+
dateformat
+
datetime
+
day
+
deb
+
debian
+
debug
+
debugging
+
decorator
+
decreasing
+
delay
+
delete
+
derivative
+
destructorsc
+
dialog
+
dictionary
+
directory
+
disk
+
dns
+
documentation
+
dom
+
domain
+
download
+
dpkg
+
dribble
+
dump
+
duplicate
+
e4x
+
each
+
email
+
enum
+
epoch
+
errors
+
event
+
eventdispatcher
+
eventlistener
+
eventtarget
+
evil
+
example
+
excerpt
+
exchange
+
export
+
extension
+
extensions
+
factorial
+
factorization
+
factory
+
fft
+
fibonacci
+
file
+
filename
+
filereader
+
files
+
filesystem
+
find
+
firebug
+
flac
+
force
+
foreach
+
fork
+
formatmoney
+
forms
+
fortune
+
forward
+
frames
+
ft12
+
function
+
functional
+
functions
+
gcc
+
gcd
+
general
+
generator
+
generic
+
generqator
+
get
+
getters
+
gis
+
gmp
+
gmt
+
go
+
google
+
goto
+
growl
+
gvim
+
gzip
+
hack
+
hanoi
+
hashtable
+
haystack
+
header
+
headers
+
heat
+
helloworld
+
heredoc
+
hex
+
hibernate
+
higher-order-function
+
html
+
html5
+
htmlcollection
+
http
+
hyperlink
+
hypotenuse
+
id
+
ie
+
ie8
+
ifelse
+
iffalse
+
iftrue
+
images
+
import
+
increasing
+
indentation
+
infix
+
ini
+
inject
+
integer
+
integration
+
interface
+
internet
+
introduction
+
io
+
iostream
+
ip
+
iphone
+
irc
+
is_admin_user
+
iterator
+
javadoc
+
jetpack
+
json
+
karma
+
kill
+
lazy-evaluation
+
libnotify-bin
+
linkedlist
+
linq
+
linux
+
list
+
listprocessing
+
lists
+
live
+
localtime
+
locate
+
log
+
logged-onuser
+
login
+
logon
+
lsof
+
macrology
+
macros
+
math
+
mbr
+
md5
+
memoization
+
memory
+
merge
+
merging
+
mersenne
+
meta
+
metaprogramming
+
methods
+
mfc
+
min-height
+
mixin
+
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
+
opengl
+
option
+
org
+
output
+
packages
+
palindrome
+
parse
+
parsec
+
parser
+
parsing
+
password
+
perldns
+
php
+
ping
+
pipe
+
plugin
+
port
+
post
+
predicate
+
prefix
+
primalitytest
+
primefactorization
+
primenumbergeneration
+
primenumbers
+
primes
+
probability
+
process
+
processes
+
processing
+
profiling
+
progress
+
project-euler
+
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
+
rtf
+
runtime
+
search-pattern
+
selectors
+
seo
+
sequence
+
server
+
setters
+
sh
+
shares
+
shell
+
shuffle
+
singleton
+
size
+
smtp
+
socket
+
softlink
+
solaris
+
solr
+
sort
+
spaces
+
spoof
+
spring
+
sql
+
static
+
statistics
+
storedprocedures
+
stream
+
string
+
strings
+
stringsreverse
+
stringutils
+
subdirectories
+
substring
+
sum
+
svn
+
symbol
+
syntax
+
tables
+
tagbody
+
tak
+
tar
+
tasks
+
tcp
+
tdistribution
+
telemechanics
+
template
+
templatehelper
+
templates
+
templating
+
terminal
+
ternary
+
textcontent
+
thread
+
thumbnail
+
ti-85
+
time
+
timedelta
+
times
+
timezone
+
to
+
tokenize
+
tostring
+
transfer
+
tree
+
triangle
+
trick
+
trigonometry
+
trim
+
ubuntu
+
unique
+
unix
+
unorthodox
+
unwatch
+
url
+
user
+
utility
+
uuid
+
validation
+
variable
+
watch
+
web
+
webserver
+
webworker
+
whilefalse
+
whiletrue
+
whitespace
+
widgets
+
windows
+
wordpress
+
words
+
writermonad
+
x86
+
xargs
+
xcode
+
xev
+
xml
+
xmllist
+
zen
+
zshell
+