Skip to content

Instantly share code, notes, and snippets.

Benjamin Fleischer bf4

Block or report user

Report or block bf4

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
bf4 / errors.html.erb
Last active Feb 18, 2018
Rails Router
View errors.html.erb
<% if Rails.env.development? || %>
More verbose errors
<% end %>
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)
You can’t perform that action at this time.