Skip to content

Instantly share code, notes, and snippets.

Avatar

Erik Terpstra eterps

View GitHub Profile
View cs.md

Why I barely read SF these days By Charlie Stross Being a guy who writes science fiction, people expect me to be well-informed about the current state of the field—as if I'm a book reviewer who reads everything published in my own approximate area.

(This is a little like expecting a bus driver to have an informed opinion on every other form of four-wheeled road-going transport.)

Similarly, marketing folks keep sending me SF novels in the hope I'll read them and volunteer a cover quote. But over the past decade I've found myself increasingly reluctant to read the stuff they send me: I have a vague sense of dyspepsia, as if I've just eaten a seven course banquet and the waiter is approaching me with a wafer-thin mint.

This isn't to say that I haven't read a lot of SF over the past several decades. While I'm an autodidact—there are holes in my background—I've read most of the classics of the field, at least prior to the 1990s. But about a decade ago I stopped reading SF short stories, and this past decade I'v

View diigo_crash.js
Error in event handler for (unknown): TypeError: Cannot read property 'resp' of undefined
at chrome-extension://pnhplgjpclknigjpccbcnmicgcieojbh/js/content/diigolet.js:129:425
@eterps
eterps / GoldenScheme.js
Created Apr 30, 2017
gist of GoldenScheme.js
View GoldenScheme.js
// License of this source is BSD License.
var GoldenScheme = function() {
// Get debug DOM
this.debugDom = document.getElementById("debug");
if (this.debugDom == null) {
this.debugDom = document.body;
}
// Firefox 莉・螟門ッセ遲�
if(typeof(console) == "undefined") {
console = {
@eterps
eterps / example1.json
Last active Mar 21, 2017
json-ld example
View example1.json
{
"@context": "https://schema.org",
"@type": "Person",
"familyName": "Simpson"
}
@eterps
eterps / 0_reuse_code.js
Created Mar 7, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View ddd_example.rb
# Inverting Dependencies: Hexagonal Architecture
# A Blog post
class Post
def self.write_new_from(title, content)
new(title, content)
end
private
@eterps
eterps / cuke2json.rb
Created May 16, 2016
Converts a Gherkin file to JSON
View cuke2json.rb
#!/usr/bin/env ruby
require 'json'
require 'gherkin/parser'
filename = ARGV[0]
src = open(filename).read
parser = Gherkin::Parser.new
gherkin_document = parser.parse(src)
scenarios = gherkin_document[:feature][:children].select{|n| n[:type] == :Scenario}
line = gherkin_document[:feature][:location][:line]
View sequel_playground.rb
#!/usr/bin/env ruby
require 'sequel'
require 'logger'
require 'awesome_print'
DB = Sequel.sqlite
DB.create_table :people do
primary_key :id
String :name
@eterps
eterps / event_sourcing.rb
Created Mar 22, 2016
Playing around with event sourcing principles
View event_sourcing.rb
require 'yaml'
class Storage # Normally should be Redis or Kafka?
def self.events
@events ||= []
end
end
# Aggregates (models)
View keybase.md

Keybase proof

I hereby claim:

  • I am eterps on github.
  • I am eterps (https://keybase.io/eterps) on keybase.
  • I have a public key ASBdMN2hfTUxgMovEIPOEH4e9qAXplhPeYciuLAl2LnMKwo

To claim this, I am signing this object: