Skip to content

Instantly share code, notes, and snippets.

View andywerner's full-sized avatar

Andy Werner andywerner

  • JobNinja
  • Munich, Germany
View GitHub Profile
@andywerner
andywerner / font_grabber.rb
Last active November 24, 2017 13:39 — forked from ttscoff/font_grabber.rb
Give it a <link> from Google fonts or a css file downloaded from google fonts and get back CSS with fonts embedded
#!/usr/bin/ruby
# encoding: utf-8
# Grab google web fonts and embed them as base64 data URIs
# <http://brettterpstra.com/2015/03/14/embedding-google-web-fonts/>
require 'base64'
if ARGV.length > 0
input = ARGV
elsif STDIN.stat.size > 0
input = STDIN.read.strip.split(/\n+/)
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
// IMPORTANT: Requires one row (atr least?) to be "frozen" as column headers!!!! Fails otherwise!
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';