Skip to content

Instantly share code, notes, and snippets.

@callahad
callahad / persona-tweaks.patch
Last active December 22, 2015 06:09
MediaGoblin / Persona siteName, siteLogo, and backgroundColor patch
From a7c2105e2940ef037600de92faee1e33610440b2 Mon Sep 17 00:00:00 2001
From: Dan Callahan <dan.callahan@gmail.com>
Date: Tue, 3 Sep 2013 15:31:28 -0500
Subject: [PATCH] Add site name, logo, and background for Persona
---
mediagoblin/plugins/persona/static/js/persona.js | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/mediagoblin/plugins/persona/static/js/persona.js b/mediagoblin/plugins/persona/static/js/persona.js
@callahad
callahad / QR.go
Created July 17, 2013 03:32
The Golang stage from mame/quine-relay, after running through the gofmt pretty printer.
package main
import (
"fmt"
"strings"
)
func main() {
fmt.Print("print\x27" + strings.Replace("import Data.Char@nmain=putStrLn$@\"procedure main();write(@@@\"DO,1<-#@\"++show(length s)++f s 1 0;f(x:t)i c=let v=foldl(@@a x->a*2+(mod x 2))0$take 8$iterate(flip div 2)$Data.Char.ord x in(if mod i 4<1then@\"PLEASE@\"else@\"@\")++@\"DO,1SUB#@\"++show i++@\"<-#@\"++show(mod(c-v)256)++@\"@@@@n@\"++f t(i+1)v;f[]_ _=@\"PLEASEREADOUT,1@@@@nPLEASEGIVEUP@@@\");end@\";s=(@\".class public QR@@n.super java/lang/Object@@n.method public static main([Ljava/lang/String;)V@@n.limit stack 2@@ngetstatic java/lang/System/out Ljava/io/PrintStream;@@nldc @@@\"class QR{public static void main(String[]v){String c[]=new String[8000],y=@@@@@@@\"@@@@@@@\",z=y,s=@@@@@@@\"+q,T+n,J,O,U,F,S,O,B,M+L,D,P,O,T,U,B,i,;+d+e+c+e+h+L,Y+L,J+i,=,D+N,0,2+z,.,4+L,<+c+c,Q,S,h,U,<+f+t+T-C+t-;+c,n,M+k-G-G,O-G+4+q->-A,G-G+L+Q,T-W-N-D-N-<+Z,B,T,T,F,N,C,M,Z-W-B-D,a-G,c+Z,N,F,U,I,P,E-W,t,B,U,J,D-W,W,P,J-z-D+L,-,B,h-G-F-D+U-G,a+Z,F,i,S,Z,Q.2,i-W,M,E,t,S-a-H-
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const
assert = require('assert'),
gmailEq = require('../lib/gmail_compare.js'),
vows = require('vows');
var suite = vows.describe('Gmail Equivalence');
@callahad
callahad / bigtent-yahoo.py
Created December 19, 2012 16:59
Yahoo BigTent Selenium Tests
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.keys import Keys
# Utility Functions
@callahad
callahad / gist:4322528
Created December 17, 2012 21:37
Proposed edits to Crystal's blog post

Apps vs. Web and Why Identity Is Key

Response to Vibhu Norby’s post: Why We’re Pivoting from Mobile-first to Web-first

My TL;DR

An ad-revenue based mobile app necessitates a fast-growth strategy that pushes high volumes of new users. The tools to optimize that conversion funnel (a/b testing) don’t work on mobile because of the clunky update process. With all the discussion of apps vs web, it’s easy to lose sight of the critical point in this article: sign up friction is A KEY REASON for apps being unable to monetize.

@callahad
callahad / lenny-to-wheezy.sh
Created March 7, 2011 05:14
Upgrade a fresh Debian 5 (Lenny) Slicehost VM to Debian Testing (Wheezy), unattended.
#!/bin/bash
# -- Set up environment variables for unattended installation of packages
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
# -- Update to a newer debian-archive-keyring
aptitude update
aptitude -q -y install debian-archive-keyring
@callahad
callahad / gist:757767
Created December 28, 2010 21:43
My solution for VimGolf Challenge "Braces or Brackets?" at http://vimgolf.com/challenges/4d1a522ea860b7447200010b
# 50 Characters
Vjj:!tr '{}[()' '(){[]'
jj$r{j3lr(7wlr)jr}j0.ZZ
# 49 Characters
Vjj:!tr '{}[()' '(){[]'
jj$r{jf{r(f}r)jr}j0.ZZ
# 48 Characters
Vjj:!tr '{}[()' '(){[]'