Skip to content

Instantly share code, notes, and snippets.

@jimbog
jimbog / helper.js
Last active August 29, 2015 14:09 — forked from gwendall/helper.js
UI.registerHelper('_', function() {
arguments = _.toArray(arguments);
var self = this,
fn = arguments[0];
arguments.shift(); // Removes the Underscore function
arguments.pop(); // Remove the Spacebars appended argument
return _[fn].apply(self, arguments);
});
/*
@jimbog
jimbog / events.html
Created November 21, 2014 04:42
where is waldo with for js events class
<!DOCTYPE html>
<html>
<head lang="en">
<style></style>
<meta charset="UTF-8">
<title>Where is Waldo</title>
</head>
<body>
<img src="waldo.jpg" alt="waldo"/>
<br/>
@jimbog
jimbog / server.js
Created December 8, 2014 21:16
simple node http server
var http = require("http");
http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
response.end();
}).listen(8888);
@jimbog
jimbog / server.js
Created December 8, 2014 23:23
simple http server
var http = require("http");
http.createServer(onRequest).listen(8888);
function onRequest(request, response){
response.writeHead(200, {"Content-type": "text/plain"});
response.write("Hey I'm on the internets");
response.end();
}
@jimbog
jimbog / helper.js
Last active August 29, 2015 14:11 — forked from gwendall/helper.js
UI.registerHelper('_', function() {
arguments = _.toArray(arguments);
var self = this,
fn = arguments[0];
arguments.shift(); // Removes the Underscore function
arguments.pop(); // Remove the Spacebars appended argument
return _[fn].apply(self, arguments);
});
/*
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.6.0/pure-min.css">
<title>Canvas Graphs</title>
<style>
body {
margin: 1em 1em 1em 1em;
}
Red [needs: view]
turtle: #()
win: layout [ panel [
tfield: base 500x500 white draw []
origin tfield/offset tlayer: base 500x500 255.255.255.255 draw [] ]
panel [
text "History" return history: text-list 200x350 data [] return
panel [ button "Save" [save request-file history/data]
@jimbog
jimbog / rhymes.clj
Created December 16, 2017 23:24 — forked from ftrain/rhymes.clj
Annotated rhyming dictionary
;; This is at: https://gist.github.com/8655399
;; So we want a rhyming dictionary in Clojure. Jack Rusher put up
;; this code here:
;;
;; https://gist.github.com/jackrusher/8640437
;;
;; I'm going to study this code and learn as I go.
;;
;; First I put it in a namespace.
total = 0
def hanoi(n, _from, _to, _support):
global total
if n == 1:
total += 1
print 'move', n, 'from: ', _from, 'to', _to
else:
hanoi(n - 1, _from, _support, _to)
total += 1
print 'move', n, 'from: ', _from, 'to', _to
@jimbog
jimbog / AppSyncAPI.yaml
Created December 12, 2019 18:49 — forked from adrianhall/AppSyncAPI.yaml
A CloudFormation template for DynamoDB + Cognito User Pool + AppSync API for the Notes tutorial
---
Description: AWS AppSync Notes API
Parameters:
APIName:
Type: String
Description: Name of the API - used to generate unique names for resources
MinLength: 3
MaxLength: 20
AllowedPattern: '^[a-zA-Z][a-zA-Z0-9_]*$'