Skip to content

Instantly share code, notes, and snippets.

View benjaminjackson's full-sized avatar

Benjamin Jackson benjaminjackson

View GitHub Profile
@benjaminjackson
benjaminjackson / kickstarter_csv.rb
Created April 19, 2012 02:24
Screen Scraping Script for Kickstarter Projects
# Usage: ruby kickstarter_csv.rb output.csv
require 'rubygems'
require 'kickstarter'
LAST_REPORT_DATE = Date.parse("April 28, 2011")
FIELDS = [:name, :pledge_amount, :pledge_percent, :pledge_deadline, :owner]
def fetch_projects_for_category category, file
@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
@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 / 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 / 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>
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 \

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

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

##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.)
### 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: