Skip to content

Instantly share code, notes, and snippets.

Benjamin Fleischer bf4

View GitHub Profile
bf4 / Gemfile
Last active Nov 11, 2017
Download my destroyallsoftware videos
View Gemfile
# A sample Gemfile
source ""
gem 'mechanize'
bf4 /
Last active Oct 16, 2017 — forked from claudijd/update.rb
ways to manually update RubyGems without susceptibility to CVE-2015-3900 ref:

ways to manually update RubyGems without susceptibility to CVE-2015-3900 (until there is a new ruby release)

because gem update --system uses rubygems to get the newest rubygems-update gem, and the vulnernability is in rubygems...

via ruby:

\curl -sSL | \
  tar xzvf - --include 'update.rb' -O | ruby
bf4 / ability.rb
Last active Oct 14, 2017
Cancan, rolify, and active admin
View ability.rb
class Ability
include CanCan::Ability
def initialize(user)
user ||= # guest user (not logged in)
if user.has_role? :admin # rolify
can :manage, :all
can :access, :ckeditor
# Performed checks for actions:
can [:read, :create, :destroy], Ckeditor::Picture
View test_schema_jsonapi.json
"$schema": "",
"description": "JSON:API Schema",
"type": "object",
"properties": {
"link": { "$ref": "file://schemata/link.json#" },
"meta": { "$ref": "file://schemata/meta.json#" }

A collection of Linux commands and concepts I tend to forget

View gist:e9a7016e4c5dca2d6b8a19d6e10d23c0

Step 0. Install Docker

Step 1. For your chosen project, decide where you want to store your notebooks and files in a workingfolder.

Step 2. Open that folder in the terminal cd workingfolder

Step 3. Run this command

docker run -it --rm -v $PWD:/home/jovyan/work -p 8888:8888 jupyter/all-spark-notebook


A technique for writing parsers.


  • Easy to understand
  • Generally applicable
  • Full power of the programming language at your disposal
  • Declarative
bf4 /
Last active Aug 2, 2017
Analytics, Metrics and Error monitoring services (and roll your own via logging, etc)
bf4 / setup-pow.bash
Created Nov 10, 2015
pow and powprox install/reinstall
View setup-pow.bash
#!/usr/bin/env bash
install() {
brew cask list lunchy >/dev/null || brew cask install lunchy
cd # In case user uses gemsets, ensure we're installing powder outside of a project
bf4 /
Last active Jun 30, 2017
clone_all repos

Clone all repos

Install as follows

\curl -sSL | \
  tar xzvf - --include '*setup' -O | bash

optionally first set PROJECT_DIR and PROJECT_CLONE_URL in your ~/.profile

You can’t perform that action at this time.