Skip to content

Instantly share code, notes, and snippets.

View indatawetrust's full-sized avatar
🏠
Working from home

indatawetrust

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am indatawetrust on github.
  • I am cond (https://keybase.io/cond) on keybase.
  • I have a public key whose fingerprint is F3E2 8A49 3342 8594 9727 4A80 AE79 AF8A FC9A 6244

To claim this, I am signing this object:

array = fn i,j -> i..j |> Enum.to_list end
IO.puts array.(1,5)
# log
# [1,2,3,4,5]
odd = &(rem(&1,2) != 0)
1..10 |> Enum.filter(odd)
# log
# [1,3,5,7,9]
log = &(&1.(&2))
hello = fn p -> "hello " <> p end
log.(hello,"world")
# log
# "hello world"
@indatawetrust
indatawetrust / for.ex
Created August 2, 2016 14:46
elixir for
log = fn ->
1..1_000 |> Enum.map(fn(num) -> IO.puts num end)
end
log.()
# log
# 1
# 2
# 3
@indatawetrust
indatawetrust / dockerinstall.sh
Created August 1, 2016 09:23
ubuntu docker install
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install linux-image-extra-`uname -r`
sudo apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get install docker-engine
function b(c) {
return new Promise((resolve,reject) => {
resolve(c * 2)
})
}
const list = []
async function a() {
for(let i=1;i<=5;i++){
const list = ["a","b","c","d","e"]
function * up() {
for(let i of list) {
yield new Promise((resolve,reject) => {
resolve(i)
})
}
}
const list = ["a","b","c","d","e"]
function * up() {
for(let i of list) {
yield i
}
}
const b = up()
@indatawetrust
indatawetrust / gulpfile.js
Created July 24, 2016 14:02
gulp nodemon
var gulp = require('gulp')
var nodemon = require('gulp-nodemon')
gulp.task('debug', function () {
nodemon({
execMap: {
js: 'node-inspector & node --debug'
},
ext: 'js jade',
ignore: ['.idea/*', 'node_modules/*', 'public/*', 'docs/*'],