Skip to content

Instantly share code, notes, and snippets.

tomholford

Block or report user

Report or block tomholford

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
@tomholford
tomholford / web.js
Created Sep 27, 2016 — forked from ntreadway/web.js
Express server for deploying to Heroku with Angular.
View web.js
var express = require("express"),
app = express.createServer(express.logger());
port = process.env.PORT || 3000;
app.configure(function(){
app.use(express.methodOverride());
app.use(express.bodyParser());
app.use(express.static(__dirname + '/'));
app.use(express.errorHandler({
dumpExceptions: true,
@tomholford
tomholford / classifier.rb
Created Jun 7, 2018
even / odd classifier using proc
View classifier.rb
f = proc do |p|
Hash.new.merge(
->{ p.odd? }.call => 'odd',
->{ p.even? }.call => 'even'
).fetch(true)
end
=> #<Proc:0x00007ff91188af38@(irb):1>
> f[1]
=> "odd"
@tomholford
tomholford / external_link_to.md
Last active Jun 25, 2019
Rails link_to helper for external links that open a new tab
View external_link_to.md
You can’t perform that action at this time.