Skip to content

Instantly share code, notes, and snippets.

@bf4
bf4 / README.md
Last active October 16, 2017 15:39 — forked from claudijd/update.rb
ways to manually update RubyGems without susceptibility to CVE-2015-3900 ref: http://blog.rubygems.org/2015/05/14/CVE-2015-3900.html

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 https://gist.github.com/bf4/4223e83e8becacfb2a8e/download | \
  tar xzvf - --include 'update.rb' -O | ruby

A collection of Linux commands and concepts I tend to forget

@bf4
bf4 / gist:e9a7016e4c5dca2d6b8a19d6e10d23c0
Created August 9, 2017 03:20 — forked from lvnilesh/gist:e44e3dd1c97eb0467e7d71594e1e9744
How I like to run my Jupyter notebooks

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

What

A technique for writing parsers.

Why

  • Easy to understand
  • Generally applicable
  • Full power of the programming language at your disposal
  • Declarative
@bf4
bf4 / reminder.py
Created November 25, 2015 08:35 — forked from bmaca/reminder.py
A python program to remind you to take a break every hour on your 8 hour work shift ;)
import time
import webbrowser
total_breaks = 8
break_count = 0
while (break_count < total_breaks):
time.sleep(3600)
webbrowser.open("https://31.media.tumblr.com/288d6e631cd930de65547ef5044fefb8/tumblr_mlksb86paT1qbuvyto1_500.gif")
break_count = break_count + 1
@bf4
bf4 / learn_clojure_recipe.md
Created March 14, 2017 20:40 — forked from pricees/learn_clojure_recipe.md
Recipe to Learn Clojure
@bf4
bf4 / go_kinesis_with_structs.go
Created March 14, 2017 20:39 — forked from pricees/go_kinesis_with_structs.go
Go + AWS Kinesis + Encode/Decode Structs
/**
NOTE:
Assumes env contains aws credentials:
AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY
AWS_SECRET_KEY_ID or AWS_SECRET_KEY
and AWS_REGION_NAME (e.g. 'US-EAST-1')
see EnvAuth() below
*/
@bf4
bf4 / dontforget.bash
Created February 20, 2017 02:19 — forked from ttscoff/dontforget.bash
Quick reminders from Terminal (bash)
#!/bin/bash
# dontforget
#
# A stupid script for short term reminders in bash
#
# Arguments just need to contain a number and a bunch of words.
#
# The number can be anywhere in the arguments, but there shouldn't
# be any other numeric digits.
#
@bf4
bf4 / _dev_badge.html.slim
Created February 1, 2017 16:48 — forked from stevenharman/_dev_badge.html.slim
A simple badge that shows your Rails environment.
/ In app/views/shared/
#dev-badge
span= Rails.env
span It ain't production!
require 'warden/github'
class SidekiqGithubChecker
def self.registered(app)
app.helpers do
def warden; env['warden'] end
def github_organization_authenticate!(name)
unless warden.user.organization_member?(name)
halt [401, {}, ["You don't have access to organization #{name}"]]
end