Instantly share code, notes, and snippets.

View brainfuck.go
package main
import (
"fmt"
)
const bf = "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>."
func main() {
cursor := 0
View qs
quicksort :: (Ord a) => [a] -> [a]
quicksort [] = []
quicksort (x:xs) =
let big = quicksort [i | i <- xs, i > x]
small = quicksort [i | i <- xs, i <= x]
in small ++ [x] ++ big
View gist:e9866af6439ef082232404d923083287
scala> def sum(l: List[Int]): Int = { l.fold(0) (_ + _) }
sum: (l: List[Int])Int
scala> sum(List(1,2,3,4))
res21: Int = 10
scala> sum(List(1))
res22: Int = 1
scala> sum(List())
View gist:5f71388f424189315721b6ad7b62cfd9
scala> def sum(l: List[Int]): Int = l match{
| case Nil => 0
| case x::xs => x + sum(xs)
| case x::Nil => x
| }
sum: (l: List[Int])Int
scala> sum(List(1,2,3))
res0: Int = 6
View gist:94df66fb53cde41348f62216128cd31c
upstream php {
server BACKEND;
}
server {
listen 80;
server_name SERVER_NAME;
access_log /dev/stdout;
error_log /dev/stderr;
View gist:2283052b6885e950ecb1463b4ede78a0
upstream php {
server BACKEND;
}
server {
listen 80;
server_name SERVER_NAME;
access_log /dev/stdout;
error_log /dev/stderr;