Skip to content

Instantly share code, notes, and snippets.

Jacob Burenstam buren

Block or report user

Report or block buren

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
View WaybackArchiver.postman_collection.json
"variables": [],
"info": {
"name": "WaybackArchiver",
"_postman_id": "e073f167-ab7a-2b60-024b-0e6d405cb45e",
"description": "API for",
"schema": ""
"item": [
View import_industries.rb
sv_lang = Language.find_by(lang_code: :sv)
en_lang = Language.find_by(lang_code: :en)
ar_lang = Language.find_by(lang_code: :ar)
root_industry = nil
result = do |row|
sv, en, ar = row
is_root_industry = false
if sv.start_with?('__')
buren / parse_documents.rb
Last active Jun 25, 2017
Parse documents with the yomu gem.
View parse_documents.rb
require 'yomu'
filename_or_stream = ARGV[0] # This could also be a tempfile or any object that responds to #read
parsed_document =
metadata = parsed_document.metadata
result = {
title: metadata['title'],
created_at: metadata['meta:creation-date'],
buren /
Created May 12, 2017
Just Arrived - Dev machine setup

Just Arrived - Dev machine setup

  1. Install Homebrew

    First of all install Homebrew a.k.a brew (OSX package manager, like apt-get).

    Goto and follow the instructions.

  2. Install Command Line Tools

View europe-geojson.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
buren / first_time_job_performers.sql
Created Mar 7, 2017
Total first time job performers between dates
View first_time_job_performers.sql
-- First time job performers between dates
SELECT user_performed_in_range.user_id FROM (
SELECT as user_id,
COUNT( as user_performed_jobs_count
FROM "jobs"
INNER JOIN job_users on job_users.job_id = AND job_users.will_perform = true
INNER JOIN users on job_users.user_id =
WHERE (job_end_date >= {start_time} AND job_end_date <= {end_time})
AND cancelled = false
buren / skills-sql-foo.sql
Created Feb 7, 2017
Map user skills to rule the world
View skills-sql-foo.sql
SELECT "users"."id", "users"."email",
"user_skills1"."skill_id", "user_skills1"."proficiency", "user_skills1"."proficiency_by_admin",
"user_skills2"."skill_id", "user_skills2"."proficiency", "user_skills2"."proficiency_by_admin"
FROM "users"
INNER JOIN "user_skills" as user_skills1 ON "user_skills1"."user_id" = "users"."id" AND (user_skills1.skill_id = 1 AND (user_skills1.proficiency >= 3 OR user_skills1.proficiency_by_admin >= 3))
INNER JOIN "user_skills" as user_skills2 ON "user_skills2"."user_id" = "users"."id" AND (user_skills2.skill_id = 26 AND user_skills2.proficiency_by_admin >= 1)
buren / gem_inline_install.rb
Created Aug 7, 2016
Install gems on demand, in scripts, using Bundler inline.
View gem_inline_install.rb
require 'bundler/inline'
gemfile(true) do # `true` means install on demand
source ''
gem 'sinatra'
buren / gem_irb_session.rb
Created Jun 23, 2016
Start a IRB session with a gem loaded
View gem_irb_session.rb
# From
task :console do
require 'irb'
require 'irb/completion'
require 'my_gem'
buren / a-jsonapi-datastore.js
Last active Mar 29, 2016
Example jsonapi-datastore usage
View a-jsonapi-datastore.js
var fs = require('fs')
var JsonApiDataStore = require('jsonapi-datastore').JsonApiDataStore;
function readExampleToObject(fileName, callback) {
fs.readFile(fileName, 'utf8', function (err, data) {
if (err) {
return console.log(err);
return callback(JSON.parse(data));
You can’t perform that action at this time.