Skip to content

Instantly share code, notes, and snippets.

@jaredly
jaredly / config.js
Last active December 17, 2015 05:49
This is my spiral for zen photon garden
// Constants for you to play around with :)
scope.ctx = {
x0: ['cx', 0, -100, 100],
y0: ['cy', 0, -100, 100],
radius0: [100, 10, 200], // pixels
finalRadius: [200, 10, 400],
theta0: [0, 0, Math.PI*2], // in radians. 2*PI = full circle
segments: [10, 3, 50],
segLength: [1, 0, 10, 0.1], // 1 makes a continuous spiral
numCircles: [1, 0.1, 3, 0.1],
@jaredly
jaredly / code.js
Last active December 17, 2015 11:29
Concentric circles for zen photon garden
// calculated, cached constants
var deltaTheta = (Math.PI * 2) / c.segments
, deltaRadius = (c.finalRadius - c.radius0) / c.numCircles;
for (var j=0; j < c.numCircles; j++) {
var radius1 = c.radius0 + j * deltaRadius;
// Create the walls
for (var i=0; i < segments; i+=1) {
var theta1 = c.theta0 + i * deltaTheta
, theta2 = theta1 + deltaTheta * c.segLength
@jaredly
jaredly / gist:6167236
Created August 6, 2013 18:32
events thoughts

Data that you get with "start job"

Current (from strider/lib/jobs.js)

- user_id
- github_apikey
- job_id
- repo_config (unsanitized)
- deploy_config
@jaredly
jaredly / mongoose.js
Created September 12, 2013 15:22
I would like to be able to in my mongoose schema specify an object with a variable number of keys whose corresponding values should all conform to a specified schema; similar to the ability to make an array with a variable number of elements who all follow a given schema. Is this possible?
{
"branches": {
"#keyname#": {
"name": String,
"count": Number
}
}
}
// such that the following would be validated
@jaredly
jaredly / gist:6645655
Last active December 23, 2015 13:59
docker status
7e26b94f74e6: Downloading 3.228 MB/308.2 MB (1%)
a735ab309154: Download complete
27488ba872a7: Download complete
6215f7a624d0: Downloading 6.996 MB/305 MB (2%)
41b9fe70bb35: Download complete <------- strider/strider:latest
ffa84c7c71a1: Downloading 2.152 MB/308.5 MB (1%)
790f6a7186b0: Downloading 2.162 MB/304.9 MB (1%)
b750fe79269d: Download complete
33a9d5922405: Download complete
27cf78414709: Download complete
@jaredly
jaredly / quick.md
Created October 16, 2013 05:34
Strider quickstart

Grab the repo

git clone https://github.com/Strider-CD/strider.git && cd strider
git checkout --track origin/1_4_refactor
npm install
make serve

Done!

<input ng-model="account.api_key" placeholder="api key">
<button class="btn" ng-click="save()">Save</button>
@jaredly
jaredly / index.html
Last active December 5, 2016 16:12
Record Video
<!DOCTYPE HTML>
<html>
<head>
<title>Video recording demo</title>
<link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css">
<link rel="stylesheet" type="text/css" href="index.css">
</head>
<body>
<video autoplay></video>
@jaredly
jaredly / Perceptron.ipynb
Last active January 4, 2016 13:49
Perceptrons, Irises and Voting
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jaredly
jaredly / Perceptron.ipynb
Created January 30, 2014 06:14
Submission Perceptron Notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.