Skip to content

Instantly share code, notes, and snippets.

View dlindahl's full-sized avatar

Derek Lindahl dlindahl

View GitHub Profile
@dlindahl
dlindahl / server.js
Created August 19, 2013 20:40
Simple Server-Sent Event example that somehow prevents the NodeJS process from handling more than 6 open connections.
var fs = require('fs'),
http = require('http'),
port = process.argv[2] || process.env.PORT || 3000;
http.createServer(function (req, res) {
console.log('REQ:', req.url);
if(req.url == '/') {
console.log('RENDER');
res.write('<html><body>Load the Console</body><script src="/stream.js"></script>');
res.end();
@dlindahl
dlindahl / transform.js
Created July 10, 2014 06:13
City of Sacramento API Response Transform
var _ = require('lodash');
var data = require('./data.json');
// Retrieve the header names
var headers = _(data.result.fArray).where({fHeader:true}).pluck('fStr').value();
// Transform the data
var items =
_(data.result.fArray)
.rest(headers.length) // Drop the header items
export class SignInForm extends Component {
constructor(props) {
super(props);
this.goToNext = this.goToNext.bind(this);
this.handleEmailChangeText = this.handleEmailChangeText.bind(this);
this.handleInputFocus = this.handleInputFocus.bind(this);
this.handlePasswordChangeText = this.handlePasswordChangeText.bind(this);
this.handleSignIn = this.handleSignIn.bind(this);
this.state = {
email: '',
### Keybase proof
I hereby claim:
* I am dlindahl on github.
* I am dereklindahl (https://keybase.io/dereklindahl) on keybase.
* I have a public key whose fingerprint is 0B27 6EA1 607F DDF3 FE00 98A2 0016 82D6 7C15 F5A1
To claim this, I am signing this object:
@dlindahl
dlindahl / Dockerfile
Created November 16, 2016 21:33
ETA Docker blog post code
FROM debian:jessie
RUN apt-get install socat
ENTRYPOINT [ "docker-entrypoint.sh" ]
gists
id
a2146eecf46aefbe7d5fcefa78c83397

This is an example of how to embed a gist in the blog:

@dlindahl
dlindahl / README.md
Last active February 26, 2018 09:23
SacJS Meetup Video Editing Instructions

Time delay on Ninja is about 00:05 (5 frames)

Video Editing

  1. Copy Media to external drives

  2. Open FCP

  3. Import Media

    • Leave in place
  • Create optimized media, etc.
@dlindahl
dlindahl / Dockerfile
Created September 29, 2017 18:03
Example node/docker setup
# https://medium.com/@fbzga/how-to-cache-bundle-install-with-docker-7bed453a5800
# https://github.com/zacksiri/docker-ruby-node/blob/master/Dockerfile
# https://github.com/mwallasch/docker-ruby-node/blob/master/Dockerfile
# https://github.com/shawnzhu/docker-ruby-nodejs/blob/master/Dockerfile
# http://bitjudo.com/blog/2014/03/13/building-efficient-dockerfiles-node-dot-js/
FROM ubuntu:16.04
MAINTAINER ETA
WORKDIR /tmp