Skip to content

Instantly share code, notes, and snippets.

View pascalw's full-sized avatar

Pascal Widdershoven pascalw

View GitHub Profile
@pascalw
pascalw / Dockerfile
Created December 16, 2014 07:51
Docker Ruby image based on Debian Wheezy
FROM buildpack-deps:wheezy
RUN apt-get update && apt-get install -y curl procps && rm -rf /var/lib/apt/lists/*
ENV RUBY_MAJOR 2.1
ENV RUBY_VERSION 2.1.3
# some of ruby's build scripts are written in ruby
# we purge this later to make sure our final image uses what we just built
RUN apt-get update \
@pascalw
pascalw / Dockerfile
Created January 22, 2016 13:04
Dockerfile for Maji Android projects
FROM ruby:2.1.2
RUN apt-get update && apt-get -y install apt-utils \
build-essential \
git-core \
curl libssl-dev \
libreadline-dev \
zlib1g zlib1g-dev \
libmysqlclient-dev \
libcurl4-openssl-dev \
@pascalw
pascalw / mix-test-wrapper.rb
Created January 18, 2019 07:26
VSCode Elixir umbrella app tests
#!/usr/bin/env ruby
test_file = ARGV[0]
line_no_arg = ARGV[1]
parts = test_file.scan(/.*apps\/(.*?)\/(.*)/).last
app = parts[0]
test_file_relative = parts[1]
line_no = line_no_arg ? ":#{line_no_arg}" : ""

Keybase proof

I hereby claim:

  • I am pascalw on github.
  • I am pascalw_kb (https://keybase.io/pascalw_kb) on keybase.
  • I have a public key ASD62ZZbiwFJNgkNZOiuoi7VUGYr3GBG1ue8CkQpHK3U3Qo

To claim this, I am signing this object:

@pascalw
pascalw / inline-css.rb
Last active July 29, 2023 08:40
Script to scan a directory for HTML files, inlining stylesheets into <head>. Useful for Middleman sites.
require "pathname"
require "nokogiri"
def inline_css(html_file, root)
doc = File.open(html_file) { |f| Nokogiri::HTML(f) }
stylesheet_tags = doc.css("link[rel=stylesheet]")
puts "Inlining css in #{html_file}" if stylesheet_tags.any?
stylesheet_tags.each do |stylesheet_tag|