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
#get | |
curl -H 'Content-Type: application/json' url | |
#post | |
curl -H 'Content-Type: application/json' -X POST -d "{'foo':'bar'}}" url | |
#pretty print | |
curl -s -H 'Content-Type: application/json' url | python -m json.tool | |
#simple script, docs: http://docs.python.org/library/json.html |
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
;;;Animated Bouncing Square | |
;;; | |
(require :asdf) | |
(asdf:load-system :cl-opengl) | |
(asdf:load-system :cl-glut) | |
;;initial square position and size | |
(defparameter *x* 0.0) | |
(defparameter *y* 0.0) | |
(defparameter *rsize* 25) |
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
/* JavaScript code profiling and stats tools. | |
*/ | |
var timer; | |
(function () { | |
/* Stats for function execution. | |
* @param {Function} fn Function to time. | |
* @param {Array} params Arguments to supply to function. | |
* @param {Number} iterations Number of times to execute the given 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
/* JavaScript Loop Speed Tests. | |
* 100,000,000 iterations, average of 10 runs. | |
* Run on Chromium 6.0.472.53 | |
*/ | |
/* Basic for-loop | |
* 1056.9 ms | |
*/ | |
for (var i=0; i < count; i++) { | |
1+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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<title>Doodle.js Demo - Bouncy Balls</title> | |
<!--[if IE]> | |
<script type="text/javascript" src="http://explorercanvas.googlecode.com/svn/trunk/excanvas.js"></script> | |
<![endif]--> | |
<script type="text/javascript" src="http://cloud.github.com/downloads/biilly/doodle.js/doodle-0.1.1.min.js"></script> |
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 cx = oo.canvas().width/2; | |
var cy = oo.canvas().height/2; | |
var img_w = 271; | |
var img_h = 365; | |
var img = oo.image({src:'./img/face_271x365.png', | |
x:cx - img_w/2, | |
y:cy - img_h/2, | |
axis:{x:img_w/2, | |
y:img_h/2, | |
coord:'local', |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<!--[if IE]><script type="text/javascript" src="http://explorercanvas.googlecode.com/svn/trunk/excanvas.js"></script><![endif]--> | |
<script src="./doodle-0.1.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
function init() { | |
//we'll be putting the rest of our javascript here! | |
}; | |
</script> |
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
(add-to-list 'load-path "~/emacs/lisp/") ;my lisp dir | |
(autoload 'todo-list-mode "todo-list-mode") ;load when needed | |
;a simple function that opens the file, | |
;and switches to todo-list-mode. | |
(defun open-todo-list () | |
(interactive) | |
(find-file "~/notes/TODO") | |
(todo-list-mode)) |
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
/* scenes/Box2dScene.as | |
*/ | |
package scenes { | |
import Box2D.Collision.Shapes.b2PolygonDef; | |
import Box2D.Collision.b2AABB; | |
import Box2D.Common.Math.b2Vec2; | |
import Box2D.Dynamics.Joints.b2MouseJoint; | |
import Box2D.Dynamics.Joints.b2MouseJointDef; | |
import Box2D.Dynamics.b2Body; | |
import Box2D.Dynamics.b2BodyDef; |
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
/** | |
* VectorVision + AS3Dmod example, by Billy Lamberta <www.lamberta.org>. | |
**/ | |
package { | |
import com.as3dmod.ModifierStack; | |
import com.as3dmod.modifiers.Bend; | |
import com.as3dmod.plugins.pv3d.LibraryPv3d; | |
import com.as3dmod.util.ModConstant; | |
import com.as3dmod.util.Phase; | |
import com.zavoo.svg.SvgPathsPapervision; |