Skip to content

Instantly share code, notes, and snippets.

View rhalff's full-sized avatar

Robbert Halff rhalff

  • Robbert Halff
  • Netherlands
View GitHub Profile
@rhalff
rhalff / gist:8778266
Last active August 29, 2015 13:55
Request a file
title: Request a file
description: Simple file request
Log(console/log)
Request(http/request)
Parse(json/parse)
Path(json/path)
'https://raw2.github.com/psichi/chix-platform/master/nodes/http/request.json' -> @url Request()
@rhalff
rhalff / gist:8779874
Last active August 29, 2015 13:55
IRC Client
title: IRC Bot
description: Runs an IRC Client
Bot(irc/bot)
Msg(irc/message)
Log(console/log)
Say(irc/say)
# build by index
'irc.freenode.net' -> @server Bot()
@rhalff
rhalff / InstanceOf "type"
Last active August 29, 2015 13:56
InstanceOf "type"
function InstanceOf(obj, type) {
if(obj === null) return false;
var t = typeof obj;
if(t === 'object') {
if(obj.constructor.name === type) return true;
return InstanceOf(Object.getPrototypeOf(obj), type);
} else {
return t === type;
}
}
title: Just a Math example
description: Simple math example multiplying random things
5 -> ^y Multiply(math/multiply)
Random(math/random) out -> x Multiply out -> msg Log(console/log)
# Start several times
'' -> :start Random
'' -> :start Random
title: Infinity
description: Keeps on counting and logging
# multiply by 10
10 -> @y Multiply(math/multiply)
IsFinite(object/isFinite)
# output of multiply goes to Log
Multiply out -> msg Log(console/log)
@rhalff
rhalff / Object port example
Created February 28, 2014 18:36
Demonstrates the use of an object port
title: Object port example
description: Demonstrates the use of an object port
'author' -> path Has(object/has)
'Hello World!' -> [title] in Has
'This is a description' -> [body] in Has
'Rob Halff' -> [author] in Has
Has yes -> msg Log(console/log)
Has no -> msg Log(console/log)
@rhalff
rhalff / Collect support
Created February 28, 2014 18:41
Collects an earlier created group
title: Collect support
description: Collects an earlier created group
# Create an array
'This' -> [0] in Array(array/create)
'Is' -> [1] in Array
'Just ' -> [2] in Array
'A' -> [3] in Array
'Test' -> [4] in Array
@rhalff
rhalff / Connecting to Github
Created February 28, 2014 18:45
Connect to github, read a file and fetch a tree.
title: Connecting to Github
description: Connect to github, read a file and fetch a tree.
Login(github/login), GetRepo(github/getRepo), Read(github/read)
Password(data/password), Log(console/log)
'rhalff' -> username Login
'******' -> password Login
Login github -> github GetRepo
@rhalff
rhalff / Simple Dom Counter
Last active August 29, 2015 13:56
Simple Dom Counter
title: Dom Counter
description: Simple Dom Counter
#'preview' -> id Preview(dom/getElementById)
'body' -> selector Preview(dom/querySelector)
#-> id Preview(dom/getElementById)
10 -> @timeout Wait(util/wait)
@rhalff
rhalff / Rest Server
Last active August 29, 2015 13:57
Trying to create a rest server
title: Rest Server
description: Begin of restserver
Db(mongojs/db)
Close(mongojs/close)
Insert(mongojs/insert)
Log(console/log)
# Express
Express(express/app), Listen(express/listen)