This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var util = require("util"); | |
var obj1 = function () { | |
this.color = "green"; | |
this.type = "suv"; | |
}; | |
obj1.prototype.demo = 123; | |
var obj2 = function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object RecursiveSum extends App { | |
println(sum(List(1, 2, 3, 10))) | |
def sum(nums: List[Int]): Int = { | |
@tailrec | |
def sumTail(x: Int, xs: List[Int]): Int = xs match { | |
case Nil => x | |
case y :: ys => sumTail(x + y, ys) | |
} | |
sumTail(0, nums) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@user = self | |
template = Tilt::ERBTemplate.new("#{Padrino.root}/api/views/mailers/welcome.erb").render(@user) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var trampoline = function (f) { | |
while (f && f instanceof Function) { | |
f = f.apply(f.context, f.args); | |
} | |
return f; | |
} | |
var thunk = function (fn) { | |
return function () { | |
var args = Array.prototype.slice.apply(arguments); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bilby = require('bilby') | |
loop1 = (n) -> | |
inner = (acc, i) -> | |
if(i is 0) | |
bilby.done(acc) | |
else | |
bilby.cont( -> | |
inner(acc + i, i - 1) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var gutil = require('gulp-util'); | |
var concat = require('gulp-concat'); | |
var sass = require('gulp-sass'); | |
var minifyCss = require('gulp-minify-css'); | |
var rename = require('gulp-rename'); | |
var coffee = require('gulp-coffee'); | |
var browserify = require('gulp-browserify') | |
var paths = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ARGSI="${#}" | |
if [ $ARGSI == "1" ]; then | |
git add -A && git commit -m "$1" && git push origin master | |
else | |
if [ $ARGSI == "2" ]; then | |
git add -A && git commit -m "$1" && git push origin $2 | |
else | |
if [ $ARGSI == "3" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function toon { | |
echo -n "λ>" | |
} | |
get_git_dirty() { | |
git diff --quiet || echo '*' | |
} | |
autoload -Uz vcs_info | |
zstyle ':vcs_info:*' check-for-changes true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Watch current directory (recursively) for file changes, and execute | |
# a command when a file or directory is created, modified or deleted. | |
# | |
# Written by: Senko Rasic <[email protected]> | |
# | |
# Requires Linux, bash and inotifywait (from inotify-tools package). | |
# | |
# To avoid executing the command multiple times when a sequence of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
type ( | |
tF func(int) int | |
tRF func(tF) tF | |
tX func(tX) tF | |
) |
OlderNewer