Skip to content

Instantly share code, notes, and snippets.

View veverkap's full-sized avatar

Patrick Veverka veverkap

View GitHub Profile
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
@veverkap
veverkap / gist:1842100
Created February 16, 2012 04:42
poster.rb
#!/usr/bin/env ruby
# Takes a hash of string and file parameters and returns a string of text
# formatted to be sent as a multipart form post.
#
# Author:: Cody Brimhall <mailto:cbrimhall@ucdavis.edu>
# Created:: 22 Feb 2008
require 'cgi'
require 'net/http'
require 'net/https'
@veverkap
veverkap / 01. Gemfile
Created February 25, 2012 02:09 — forked from schleg/01. Gemfile
Setup for Devise + Omniauth
gem 'pg'
group :development do
gem 'ruby-debug'
end
gem 'rake', '~> 0.8.7'
gem 'devise'
gem 'oa-oauth', :require => 'omniauth/oauth'
gem 'omniauth'
gem 'haml'
gem 'dynamic_form'
@veverkap
veverkap / sc-dl.js
Created March 6, 2012 00:40 — forked from pheuter/sc-dl.js
Bookmarklet that generates download link for a Soundcloud upload
(function(d) {
var dl = d.createElement('a');
dl.innerText = 'Download MP3';
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1];
dl.download = d.querySelector('em').innerText+".mp3";
d.querySelector('.primary').appendChild(dl);
dl.style.marginLeft = '10px';
dl.style.color = 'red';
dl.style.fontWeight = 700;
})(document);
@veverkap
veverkap / hack.sh
Created April 1, 2012 01:08 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@veverkap
veverkap / gist:2947957
Created June 18, 2012 11:29
css parser
require 'css_parser'
include CssParser
parser = CssParser::Parser.new
parser.load_uri!('http://www.redditstatic.com/reddit.7-sNzpwBHUg.css')
puts parser.find_by_selector('#header-img.default-header').inspect
puts CssParser.convert_uris(parser.find_by_selector('#header-img.default-header')[0], "http://www.redditstatic.com/reddit.7-sNzpwBHUg.css").inspect
@veverkap
veverkap / Ubuntu rbenv
Created July 20, 2012 18:07 — forked from HatemMahmoud/Ubuntu rbenv
Installing Ruby 1.9.2 with OpenSSL on Ubuntu 11.04 using ruby-build and rbenv
# for more info: https://gist.github.com/1120938
@veverkap
veverkap / gist:3238632
Created August 2, 2012 16:52
Ubuntu Nginx
sudo -s
nginx=stable # use nginx=development for latest development version
add-apt-repository ppa:nginx/$nginx
apt-get update
apt-get install nginx
@veverkap
veverkap / gist:3251067
Created August 3, 2012 20:08
profootball
http://www.pro-football-reference.com/years/1921_APFA/
http://www.pro-football-reference.com/years/1920_APFA/
http://www.pro-football-reference.com/years/1949_AAFC/
http://www.pro-football-reference.com/years/1948_AAFC/
http://www.pro-football-reference.com/years/1947_AAFC/
http://www.pro-football-reference.com/years/1946_AAFC/
http://www.pro-football-reference.com/years/1922
http://www.pro-football-reference.com/years/1923
http://www.pro-football-reference.com/years/1924
http://www.pro-football-reference.com/years/1925
@veverkap
veverkap / gist:3506715
Created August 29, 2012 04:06 — forked from jherrm/gist:1054913
startup script for unicorn with rvm global installation
#!/bin/bash
### BEGIN INIT INFO
# Provides: APPLICATION
# Required-Start: $all
# Required-Stop: $network $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start the APPLICATION unicorns at boot
# Description: Enable APPLICATION at boot time.
### END INIT INFO