Skip to content

Instantly share code, notes, and snippets.

Working from home

Weston Triemstra thermistor

Working from home
Block or report user

Report or block thermistor

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
ceejbot /
Last active Jul 17, 2019
npm's proposal for supporting ES modules in node

ESM modules in node: npm edition

The proposal you’re about to read is not just a proposal. We have a working implementation of almost everything we discussed here. We encourage you to checkout and build our branch: our fork, with the relevant branch selected. Building and using the implementation will give you a better understanding of what using it as a developer is like.

Our implementation ended up differing from the proposal on some minor points. As our last action item before making a PR, we’re writing documentation on what we did. While I loathe pointing to tests in lieu of documentation, they will be helpful until we complete writing docs: the unit tests.

This repo also contains a bundled version of npm that has a new command, asset. You can read the documentation for and goals of that comma

tkfm-yamaguchi /
Last active Jul 3, 2019
source-highlight's language definition file for YAML
@@ -169,3 +169,5 @@
groovy = groovy.lang
json = json.lang
feature = feature.lang
+yaml = yaml.lang
+yml = yaml.lang
thevangelist / my-component.spec.js
Created Aug 4, 2016
The only React.js component test you'll ever need (Enzyme + Chai)
View my-component.spec.js
import React from 'react';
import { shallow } from 'enzyme';
import MyComponent from '../src/my-component';
const wrapper = shallow(<MyComponent/>);
describe('(Component) MyComponent', () => {
it('renders without exploding', () => {
mbajur / .md
Created Apr 29, 2016
How to create small, unique tokens in Ruby
View .md

How to create small, unique tokens in Ruby

That is is basically a "fork" of blog article i'm constantly returning to. It seems that the blog is down:

My choice: Dave Bass’s rand().to_s() trick

Dave Bass proposed this which I picked up for my implementation (here for an 8-chars token):

janko / 1-activerecord.rb
Last active Jan 24, 2019
INSERTing 50,000 records into a database in ActiveRecord, Arel, SQL, activerecord-import and Sequel.
View 1-activerecord.rb
require "active_record"
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
ActiveRecord::Migration.class_eval do
create_table(:records) do |t|
t.string :column
data = { |i| Hash[column: "Column #{i}"] }
ebidel / app.html
Last active May 14, 2019
Fast Polymer app loading - optimized for first render, progressively enhanced lazy loading
View app.html
<!DOCTYPE html>
body.loading #splash {
opacity: 1;
#splash {
position: absolute;
top: 0;
dideler /
Last active Aug 26, 2019
Upgrading PostgreSQL from 9.3 to 9.4 when upgrading Ubuntu 14.04 to 14.10


Create a backup:

pg_dumpall > mybackup.sql

Perform the upgrade:

sudo pg_dropcluster 9.4 main --stop
maxim / task.yml
Created Jun 12, 2014
Adding github to known_hosts with ansible
View task.yml
- name: ensure is a known host
dest: /root/.ssh/known_hosts
create: yes
state: present
line: "{{ lookup('pipe', 'ssh-keyscan -t rsa') }}"
regexp: "^github\\.com"
franksmule / gulpfile.js
Last active Aug 8, 2017
gulp.js that does SASS, JS Concatenation Watching - Tutorial ->
View gulpfile.js
//*********** IMPORTS *****************
var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var gutil = require('gulp-util');
var rename = require("gulp-rename");
var map = require("map-stream");
var livereload = require("gulp-livereload");
var concat = require("gulp-concat");
var uglify = require('gulp-uglify');
var watch = require('gulp-watch');
cpb / example.rb
Last active Aug 29, 2015
replace method with method object
View example.rb
class UserAdder <, :company_id, :role)
extend FriendlyMethodObject
def initialize(*)
# Provide defaults for optional members
self.role ||= :default_role
def call
You can’t perform that action at this time.