Skip to content

Instantly share code, notes, and snippets.

@fangel
fangel / Makefile
Created September 13, 2018 14:46
Font subsetting using pyftsubset + sfnt2woff-zopfli
# The following variables determine which directories to look for input fonts,
# and which directory to place the output fonts in.
INDIR = input
INPUT_EXT = woff
OUTDIR = output
SUBSET_FILE = subset.txt
SUBSET_FLAGS = --layout-features='' --obfuscate-names --glyphs="space"
ZOPFLI_ITERATIONS = 15
ifneq ($(shell echo $$ITERATIONS),)
@fangel
fangel / Makefile
Last active February 3, 2017 10:15
A Makefile for automatically subsetting and optimising TTF-fonts to WOFF and WOFF2 web fonts
# The following variables determine which directories to look for input fonts,
# and which directory to place the output fonts in.
INDIR = input
OUTDIR = output
SUBSET_FILE = subset.txt
ZOPFLI_ITERATIONS = 15
ifneq ($(shell echo $$ITERATIONS),)
ZOPFLI_ITERATIONS = $(shell echo $$ITERATIONS)
endif
int leds = 25;
int _rows = 3;
int _size = 25;
int _spacing = 5;
int round = 0;
float speed_r = 1.0;
float speed_g = 1.5;
@fangel
fangel / index.coffee
Last active August 29, 2015 13:57 — forked from nickclaw/index.coffee
#
# Example usage:
#
# {MessagePaneView, PlainMessageView, LineMessageView} = require 'atom-message-pane'
# messages = new MessagePaneView()
# messages.attach()
#
# messages.add(new PlainMessageView('a message'))
# messages.add(new LineMessageView(1, 2, 'a line message', 'with a preview'))
#
@fangel
fangel / MP3.agda
Last active December 30, 2015 12:29
--
-- Mini project 3 by Morten Fangel Jensen (mfan) & Christian Harrington (cnha)
--
module MiniProject where
open import Prelude
open Nats
open LessThan
diff --git a/kernel/reduction.ml b/kernel/reduction.ml
index 6c52e15..486fb11 100644
--- a/kernel/reduction.ml
+++ b/kernel/reduction.ml
@@ -197,6 +197,7 @@ let sort_cmp pb s0 s1 cuniv =
| (_, _) -> raise NotConvertible
+let sort_cmp pb s0 s1 cuniv = cuniv
let conv_sort env s0 s1 = sort_cmp CONV s0 s1 empty_constraint
<?php
/**
* Implements hook_views_plugins().
*/
function whitepaper_views_plugins() {
return array(
'module' => 'whitepaper',
'access' => array(
@fangel
fangel / deploy.rb
Created September 16, 2011 08:41
Capistrano Drupal Deploy deploy.rb skeleton
set :stages, %w(production staging qa)
set :default_stage, "qa"
require 'capistrano/ext/multistage'
set :application, "version2"
set :user, "___DEPLOY_USER___"
set :group, "users"
set :scm, :git
set :repository, "[email protected]:___GITHUB_USER___/#{application}.git"
#!/bin/sh
# Then try and figure out which gateways to use
DEFAULT_GATEWAY=`netstat -rn | grep default | grep -v utun | head -n1 | awk '{print $2}'`
VPN_GATEWAY=`netstat -rn | grep utun | grep -v default | head -n1 | awk '{print $1}'`
if [ -z "$VPN_GATEWAY" ]; then
echo "It appears you arent on VPN. FYI, your gateway is $DEFAULT_GATEWAY."
exit -1
else
<?php
namespace sqlparser\utils;
function perform_select( $sql, $tabel, $bindings = false) {
$tree = \sqlparser\parse($sql);
if( get_class($tree) != 'sqlparser\tree\Select') throw new \sqlparser\Exception('Cannont perform non-selects with perform_select');
if( $bindings ) list($tree,,) = \sqlparser\bind_values($tree, $bindings);
return array_map( function($row) use ($tree) {