Skip to content

Instantly share code, notes, and snippets.

Jared Forsyth jaredly

Block or report user

Report or block jaredly

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jaredly
jaredly / config.js
Last active Dec 17, 2015
This is my spiral for zen photon garden
View config.js
// 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 Dec 17, 2015
Concentric circles for zen photon garden
View code.js
// 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
View gist:6167236

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 Sep 12, 2013
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?
View mongoose.js
{
"branches": {
"#keyname#": {
"name": String,
"count": Number
}
}
}
// such that the following would be validated
@jaredly
jaredly / gist:6645655
Last active Dec 23, 2015
docker status
View gist:6645655
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 Oct 16, 2013
Strider quickstart
View quick.md

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!

View gist:7102913
<input ng-model="account.api_key" placeholder="api key">
<button class="btn" ng-click="save()">Save</button>
@jaredly
jaredly / index.html
Last active Dec 5, 2016
Record Video
View index.html
<!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 Jan 4, 2016
Perceptrons, Irises and Voting
View Perceptron.ipynb
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 Jan 30, 2014
Submission Perceptron Notebook
View Perceptron.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
You can’t perform that action at this time.