Skip to content

Instantly share code, notes, and snippets.

@collin
collin / changes.ex
Created June 4, 2015 16:57
ch-ch-changes
# v1
defmodule MyApp.ThingController do
use MyApp.Web, :controller
plug :action
def an_action(conn, _params) do
text conn, "V1"
end
end
@collin
collin / hiring.md
Last active August 29, 2015 14:22
hiring.md

Full-time Ember.js Developer (contract, remote)

Codex is looking for a full-time remote ember.js developer to join our team to help build and maintain our exciting new Backbone product for the film industry. The app is a standalone Ember.js app (ember-cli) which talks to our restful json api built on express, neo4j, and redis. The product is nearing an alpha release.

http://www.codexdigital.com/products/backbone

Necessary Skills

  • Ember.js (ember-cli)
@collin
collin / superstition.sh
Created March 26, 2015 19:24
actual stack trace from node
1) "before each" hook:
Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.
at null.<anonymous> (/bin/v0.10.35/lib/node_modules/mocha/lib/runnable.js:170:19)
at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)
<!doctype html>
<html lang=“en”>
<head>
<meta charset="utf-8">
<title>About | Janet Ferguson Full Stack Web Developer</title>
<!--[if lt IE 9]>
<script src="dist/html5shiv.js"></script>
<![endif]-->
</head>
<body>
Cache-Control:3600
Connection:keep-alive
Content-Encoding:gzip
Content-Type:application/javascript
Date:Thu, 04 Sep 2014 20:49:28 GMT
etag:"da61b0fbe99dd7a95220af00ffe17231"
last-modified:Wed, 03 Sep 2014 21:00:27 GMT
Server:NetDNA-cache/2.2
Transfer-Encoding:chunked
Vary:Accept-Encoding
var confirmationQueue = new Firebase("https://static-showdown.firebaseio.com/email_confirmations");
imaginaryRouter.route("/confirm_email/:code", function(params) {
confirmationQueue.child(params.code).remove();
});
@collin
collin / gist:7439949
Created November 12, 2013 22:27
heroku logs
heroku logs --tail --app divshot-dio
2013-11-12T20:28:14.803888+00:00 app[web.2]: ":2000},"_paused":false,"_peername":{"address":"10.42.122.176","family":"IPv4","port":36430},"_httpMessage":"[Circular]"},"connection":"[Circular]","__wrapped":true,"_emittedHeader":true,"statusCode":404},"pipesCount":1,"flowing":true,"ended":false,"endEmitted":false,"reading":true,"calledRead":true,"sync":false,"needReadable":true,"emittedReadable":false,"readableListening":true,"objectMode":false,"defaultEncoding":"utf8","ranOut":true,"awaitDrain":0,"readingMore":false,"decoder":null,"encoding":null},"readable":true,"domain":{"domain":null,"_events":{},"_maxListeners":10,"members":[]},"_events":{"end":[null,null]},"_maxListeners":10,"path":".","fd":null,"flags":"r","mode":438,"autoClose":true,"destroyed":true,"closed":true},"domain":"[Circular]","domainThrown":false},"msg":"Got exception to trace:","time":"2013-11-12T20:28:14.800Z","v":0}
2013-11-12T20:28:14.805428+00:00 app[web.2]: EISDIR, read
2013-11-12T20:28:15.947380+00:0
@collin
collin / divshot.io-wercker-build.yml
Last active December 28, 2015 04:08
All this assumes the wercker scripts execute in a directory that contains a divshot.json file and the static files for your app. Would be necessary to copy the token from ~/.divshot/config/user.json
box: wercker/nodejs
# Build definition
build:
# The steps that will be executed on build
steps:
# A step that executes `npm install` command
- npm-install
# A step that executes `npm test` command
- npm-test

You can get your api-token from the divshot config file:

cat ~/.divshot/config/user.json 
{
  "token": "<SUPER SECRET TOKEN STRING>"
}

Then commands can be run via:

var fs, i, rs, ws, _i;
fs = require('fs');
for (i = _i = 1; _i <= 100; i = ++_i) {
// file-to-copy is a 4MB zip file
fs.createReadStream("./file-to-copy").pipe(
fs.createWriteStream("./copies/copy-" + i + ".zip")
);
}