Skip to content

Instantly share code, notes, and snippets.

@tjwebb
tjwebb / csv-input
Created May 20, 2017 05:33 — forked from pdemby/csv-input
csv input
IDENTIFICATION DIVISION.
PROGRAM-ID. READ-CSV.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
SELECT INPUT-FILE
ASSIGN TO DISC
ORGANIZATION IS LINE SEQUENTIAL
ACCESS MODE IS SEQUENTIAL.
SELECT OUTPUT-RECORD
@tjwebb
tjwebb / sec-rss-feed.xml
Created February 27, 2017 02:57
SEC RSS Feed
<?xml version="1.0" encoding="ISO-8859-1" ?>
<feed xmlns="http://www.w3.org/2005/Atom">
<author>
<email>[email protected]</email>
<name>Webmaster</name>
</author>
<company-info>
<addresses>
<address type="mailing">
<city>DETROIT</city>
@tjwebb
tjwebb / saw
Last active February 21, 2017 00:43
const co = require('co')
const fs = require('mz/fs')
const path = require('path')
function fixStuff (dir, fullpath = __dirname) {
return co(function *() {
const files = yield fs.readdir(path.resolve(fullpath, dir))
yield files.map(f => {
if (yield fs.stat(f).isDirectory()) {
const dir = '.' // set dir
const co = require('co')
const fs = require('mz/fs')
co(function *() {
const files = yield fs.readdir(dir)
for (const f of files) {
if (/\.csv$/.test(f)) {
yield fs.rename(f, f.replace(/\.csv$/, '.txt'))
}
@tjwebb
tjwebb / example.js
Created February 9, 2017 19:36
React PropTypes ES6
// Okay:
const Foo = class Foo extends Component {
// ...
}
Foo.propTypes = {
// ...
}
export default Foo
@tjwebb
tjwebb / mapnik-3.0.9.rb
Created January 23, 2017 21:00
Mapnik 3.0.9 homebrew formula
class Mapnik < Formula
desc "Toolkit for developing mapping applications"
homepage "http://www.mapnik.org/"
url "https://github.com/mapnik/mapnik/archive/v3.0.9.tar.gz"
sha256 "f0242606096e2c4ca2cd0caac1ff0fd5f8054a38b5f288ba38b0e397b5b311b2"
revision 1
head "https://github.com/mapnik/mapnik.git"
bottle do
@tjwebb
tjwebb / keybase.md
Created January 2, 2017 16:00
keybase.md

Keybase proof

I hereby claim:

  • I am tjwebb on github.
  • I am tjwebb (https://keybase.io/tjwebb) on keybase.
  • I have a public key whose fingerprint is A5DB EC2A A8C3 B773 24B8 A129 22DF 962F 5114 A7DE

To claim this, I am signing this object:

@tjwebb
tjwebb / mocha-output.txt
Created December 7, 2016 22:12
trailpack-express test failure
47 passing (6s)
8 pending
2 failing
1) express options Should have default methods should return 500 page on GET /default/notFound:
Uncaught AssertionError: 'Error: Cannot find module &#39;./lib/mediaType&#39;<br> &nbsp; &nbsp;at Function.Module._resolveFilename (module.js:325:15)<br> == '<h1>500</h1>'
+ expected - actual
-Error: Cannot find module &#39;./lib/mediaType&#39;<br> &nbsp; &nbsp;at Function.Module._resolveFilename (module.js:325:15)<br> &nbsp; &nbsp;at Function.Module._load (module.js:276:25)<br> &nbsp; &nbsp;at Module.require (module.js:353:17)<br> &nbsp; &nbsp;at require (internal/module.js:12:17)<br> &nbsp; &nbsp;at loadModule (/Users/tjwebb/workspace/trails/trailpack-express/node_modules/express/node_modules/accepts/node_modules/negotiator/index.js:114:16)<br> &nbsp; &nbsp;at Negotiator.mediaTypes (/Users/tjwebb/workspace/trails/trailpack-express/node_modules/express/node_modules/accepts/node_modules/negotiator/index.js:76:29)<br> &nbsp; &nbsp;at Accepts.type.Accep
@tjwebb
tjwebb / es6-class-example.js
Created October 11, 2016 16:13
ES6 Class Example
class Foo {
test () {
return this.x
}
constructor () {
this.x = 1
}
}
class Bar {
test () {
@tjwebb
tjwebb / heroku-build.log
Created September 2, 2016 04:30
what the hell semver.io? >=4 should resolve to 6.5.0
Resolving node version >= 4.0.0 via semver.io...
Downloading and installing node 5.11.1...