Skip to content

Instantly share code, notes, and snippets.

View skunkworker's full-sized avatar

John Bolliger skunkworker

View GitHub Profile
@skunkworker
skunkworker / install_vips_ubuntu.sh
Created September 2, 2017 06:01
Vips 8.5.8 install from source for Ubuntu
cd tmp/;
curl -L https://github.com/jcupitt/libvips/releases/download/v8.5.8/vips-8.5.8.tar.gz | tar xz; \
cd vips-8.5.8; \
dpkg --configure -a; \
echo "/usr/local/lib/" >> /etc/ld.so.conf.d/local.conf; \
./configure; \
make; \
sudo make install;
@skunkworker
skunkworker / .travis.yml
Created September 2, 2017 18:30
Compile Vips 8.5.8 on Travis CI
dist: trusty
before_install:
- chmod +x travis_compile_vips.sh
- ./travis_compile_vips.sh
cache:
directories:
- vips-8.5.8
@skunkworker
skunkworker / capybara.rb
Created July 21, 2017 05:01
Capybara tricks (bootstrap etc)
# How to click on a bootstrap check_box with capybara.
find(:css, 'label', text: 'Label text here').click
@skunkworker
skunkworker / package_chrome_extension.rb
Last active March 7, 2017 23:13
Package chrome extension
# Chrome Extension Packer
#
# This removes .git, development files and other files specified and then packages up a chrome extension.
# By default the manifest.json that lives in the directory is removed (local development links etc). And replaced with the manifest.json.production file.
require 'find'
require 'fileutils'
require 'json'
extension_directory = "/chrome/"

Keybase proof

I hereby claim:

  • I am skunkworker on github.
  • I am johnbolliger (https://keybase.io/johnbolliger) on keybase.
  • I have a public key ASDIEVOnq3l2azbai2nzpR-uDEXy1qMpkYHaD2s2FRhnGQo

To claim this, I am signing this object:

# MJML needs to get the fonts
def stub_google_fonts
stub_request(:get, "https://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700").
with(:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'Host'=>'fonts.googleapis.com', 'User-Agent'=>'Ruby'}).
to_return(:status => 200, :body => "/* cyrillic-ext */
@font-face {
font-family: 'Ubuntu';
font-style: normal;
font-weight: 300;
@skunkworker
skunkworker / Makefile
Created March 10, 2016 08:14
Modified makefile for 10.11 el capitan users.
CHAPTERS=book/preamble.md \
$(sort $(wildcard book/chapter-*.md))
CONTENTS=book/title.txt \
$(CHAPTERS)
ALL_FILES=$(CHAPTERS) \
book/metadata.xml \
book/title.txt \
cover.png
rails r 'File.write("./viz.html", Rails.application.routes.router.visualizer)';
ruby -r webrick -e "s = WEBrick::HTTPServer.new(:Port => 8080, :DocumentRoot => Dir.pwd); trap('INT') { s.shutdown }; s.start";
open "http://localhost:8080/viz.html"
@skunkworker
skunkworker / multiple_bootstrap_modals.js
Created August 5, 2015 18:03
Multiple Bootstrap modals
$(document).ready(function() {
$('#openBtn').click(function(){
$('#myModal').modal({show:true})
});
$('.modal').on('hidden.bs.modal', function( event ) {
$(this).removeClass( 'fv-modal-stack' );
$('body').data( 'fv_open_modals', $('body').data( 'fv_open_modals' ) - 1 );
});
@skunkworker
skunkworker / vote_group_serializer.rb
Created April 11, 2015 23:14
votes with active model serializer
class VotesGroupSerializer < ActiveModel::Serializer
attributes :group_name
has_many :votes
end