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
}
### Keybase proof
I hereby claim:
* I am benjaminjackson on github.
* I am benjaminjackson (https://keybase.io/benjaminjackson) on keybase.
* I have a public key whose fingerprint is 6F7E 37BC B4A3 52DC D789 0A27 48E2 91DF F6EF FB07
To claim this, I am signing this object:

##New

  • Header ---> This should be filled in by default with "Sponsor" but we can edit that if we want to use it for something else
  • Title
  • Dek
  • Key IMG ---> This needs to crop and size itself for iPad and iPhone, same dimensions as article cells
  • Link URL ---> This is what will open on tap. (Will be a web page, unless Video flag is on, in which case open video directly)
  • Video (Flag) ---> Is/is not video

Behavior

  • Post should generate in New whenever it's published. (Publish date should be editable in order to adjust positioning.)
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")