Skip to content

Instantly share code, notes, and snippets.

View benjaminjackson's full-sized avatar

Benjamin Jackson benjaminjackson

View GitHub Profile
@benjaminjackson
benjaminjackson / docker-full-cleanup.sh
Created August 23, 2017 17:26
Nuke all docker intermediate build files to reclaim disk space
alias docker-full-cleanup='func_full-cleanup-docker'
func_full-cleanup-docker() {
echo "WARN: This will remove everything from docker: volumes, containers and images. Will you dare? [y/N] "
read choice
if [ \( "$choice" == "y" \) -o \( "$choice" == "Y" \) ]
then
sudo echo "> sudo rights check [OK]"
@benjaminjackson
benjaminjackson / uup.rb
Created May 13, 2017 20:44
This will ping every single user on your Slack team every time they go active with "u up?"
require 'slack-ruby-bot'
class UUpBot < SlackRubyBot::Bot
command 'yeah' do |client, data, match|
client.say(text: 'me too', channel: data.channel)
end
end
class UUpServer < SlackRubyBot::Server
on 'presence_change' do |client, message|
{
"b": 2,
"a": 1
}
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/ben/.rbenv/versions/1.9.3-p448/bin/ruby extconf.rb
tar xzf /Users/ben/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/phashion-1.1.1/ext/phashion_ext/pHash-0.9.6.tar.gz 2>&1
env CXXFLAGS=' -pthread' CFLAGS=' -I/Users/ben/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/phashion-1.1.1/ext/phashion_ext/include -L/Users/ben/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/phashion-1.1.1/ext/phashion_ext/lib -L/usr/local/lib -x c++ ' LDFLAGS=' -L/Users/ben/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/phashion-1.1.1/ext/phashion_ext/lib -L/usr/local/lib -L. -L/Users/ben/.rbenv/versions/1.9.3-p448/lib ' ./configure --prefix=/Users/ben/.rbenv/versions/1.9.3-p448/lib/ruby/gems/1.9.1/gems/phashion-1.1.1/ext/phashion_ext --disable-audio-hash --disable-video-hash --disable-shared --with-pic 2>&1
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thr

More great suggestions at Podcast Thing (thanks @maxtemkin!)

Public Radio Gems

  • Radiolab - Because obviously.
  • This American Life - The best storytellers on the radio.
  • On the Media - If this podcast doesn't make you more skeptical, you probably need a gullibotomy.

Tech

sudo apt-get update
sudo apt-get install ruby1.9.1 ruby1.9.1-dev \
rubygems1.9.1 irb1.9.1 ri1.9.1 rdoc1.9.1 \
build-essential libopenssl-ruby1.9.1 libssl-dev zlib1g-dev
sudo update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.9.1 400 \
--slave /usr/share/man/man1/ruby.1.gz ruby.1.gz \
/usr/share/man/man1/ruby1.9.1.1.gz \
--slave /usr/bin/ri ri /usr/bin/ri1.9.1 \
@benjaminjackson
benjaminjackson / gist:6803521
Created October 3, 2013 01:59
UIViewControllerAnimatedTransitioning Example
//
// LFSlideTransitionAnimator.m
// Longform
//
// Created by Benjamin Jackson on 9/16/13.
// Copyright (c) 2013 Longform. All rights reserved.
//
#import <Foundation/Foundation.h>
@benjaminjackson
benjaminjackson / excel2json.rb
Created July 26, 2013 16:58
No more copying and pasting Word docs into JSON files.
#! /usr/bin/ruby
require 'iconv'
require 'roo'
require 'csv'
require 'json'
begin
ARGV.each do |file|
file_basename = File.basename(file, ".xlsx")
@benjaminjackson
benjaminjackson / minmal_twitter.css
Created September 15, 2012 14:50 — forked from cmod/minmal_twitter.css
Twitter stylebot
.trends, .bird-topbar-etched, .wtf-module, .site-footer, .topics, .connect-stream .my-tweet, .promoted-tweet {
display: none !important;
}
.wrapper, .wrapper-narrow, .wrapper-permalink {
background: none !important;
max-width: 37em !important;
}
.dashboard {
@benjaminjackson
benjaminjackson / Bot Score
Created August 1, 2012 16:07
Calculate how spammy your Twitter followers are
# Author: @benjaminjackson
require 'rubygems'
require 'uri'
require 'net/http'
require 'json'
SCREEN_NAME = 'benjaminjackson'
class Float