Skip to content

Instantly share code, notes, and snippets.

View harryfk's full-sized avatar

Harry Keller harryfk

View GitHub Profile
@harryfk
harryfk / mail.js
Last active January 29, 2017 22:31
// this is a Google Apps script which fetches a random gif from Giphy and then sends it via email to people
function sendMail(){
var url = "http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=thanks";
var response = UrlFetchApp.fetch(url, {}).getContentText();
response = JSON.parse(response);
var subject = 'Your friendly time tracking reminder.';
var body = 'Please, would you track your time today? It only takes five minutes.\n\n ';
var sender = 'Annoying Harry';
@harryfk
harryfk / showdown-interview.js
Last active August 29, 2015 14:17
showdown interview extension
(function () {
var interview = function () {
return [
{ type: 'output', filter: function(source){
var questionRegex = /(<p>)(<strong>)?(Q|speaker): /gi;
return source.replace(questionRegex, function(match, p, s, i) {
var cssClass;
if (i.toLowerCase() == 'q') { cssClass= 'text-question'; }
if (i.toLowerCase() == 'speaker') { cssClass = 'text-speaker'; }
if (s) {
@harryfk
harryfk / showdown-interview.js
Created March 5, 2015 15:22
showdown-interview.js
(function () {
var interview = function () {
return [
{ type: 'lang', filter: function(text) {
var inlineRegex = /\[([QqAa])\]\((.*?)\)/g;
text = text.replace(inlineRegex, function(match, n, t) {
var cssClass = (n == 'Q' || n == 'q') ? 'text-question' : 'text-answer';
var s = '<span class="'+cssClass+'">'+t+'</span>';
return s;
});
@harryfk
harryfk / keybase.md
Created November 28, 2014 11:09
keybase.md

Keybase proof

I hereby claim:

  • I am harryfk on github.
  • I am harryfk (https://keybase.io/harryfk) on keybase.
  • I have a public key whose fingerprint is F2F6 4C8D CE56 EE56 494F 6407 AEE7 A964 3B9A DA71

To claim this, I am signing this object:

(function () {
var footnotes = function () {
return [
{ type: 'lang', filter: function(text) {
// Use footnotes like so: "foo[^1](This is the footnote text)"
var i = 0;
var inline_regex = /\[\^(\d|n)\]\((.*?)\)/g;
text = text.replace(inline_regex, function(match, n, t) {
// We allow both automatic and manual footnote numbering
if (n == "n") n = i+1;
@harryfk
harryfk / gist:2823191
Created May 29, 2012 07:58
Sass based, fluid grid
// the basics
*
+box-sizing(border-box)
@mixin width($percent, $alignment: null)
@if $percent == 33
$percent: 33.334
@if $percent == 66
$percent: 66.667