Skip to content

Instantly share code, notes, and snippets.

@cm2
cm2 / promo_code_generator.py
Created February 3, 2017 16:53
simple script to generate memorable promo codes. its not really performant or anything just testing out an idea
#!/usr/bin/env python
from random import randint
class PromoCode:
phonemes = {
'vowel': ['i','e','a','u','o'],
'consonant': [ 'p','b','t','d','ch','k','g','f','v','th','s','sh','m','n','h','l','r' ]
}
words = [
@cm2
cm2 / mobile.html
Created November 21, 2016 22:49
Old experiment with responsive email templates
<html>
<head>
<meta name="viewport" content="initial-scale =1.0, maximum-scale = 1.0, width =device-width" />
<style type="text/css">
@media only screen and (max-width: 600px){
#content {
width: 100%;
}
#header-logo{
text-align: center;

Keybase proof

I hereby claim:

  • I am cm2 on github.
  • I am cm2 (https://keybase.io/cm2) on keybase.
  • I have a public key whose fingerprint is EFF8 184B 10A3 30DF 9B4B 5606 857F 6F95 C354 40DE

To claim this, I am signing this object:

@cm2
cm2 / geocode_from_csv.pl
Last active August 29, 2015 14:25
Geocode locations from client provided CSVs for upload.
#! /usr/bin/env perl
use warnings;
use strict;
use Google::GeoCoder::Smart;
use Text::CSV;
use Switch;
use Time::HiRes qw(usleep);
@cm2
cm2 / readinglist.xsl
Created September 22, 2014 01:04
Quick and dirty: Recover my reading list with some XSL from the Bookmarks.plist
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:template match="/">
<html>
<body>
<h1>Reading List</h1>
<table border="1" width="100%">
<thead>
@cm2
cm2 / imageserver.py
Last active August 29, 2015 14:06
Got tired of copying to the image server all the time so I wrote this little program :)
#!/usr/bin/env python2
import sys
import os
import shutil
import configparser
args = sys.argv
ini = os.path.expanduser("~/.imageserver")
@cm2
cm2 / gist:3009395
Created June 28, 2012 05:57
Playing around with HTML+CSS only tab views. Used input for state.
<!doctype html>
<html lang="en">
<head>
<title>CSS Only Tab Views</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>
body{
font-family: Helvetica, Arial, sans-serif;
background: #eee;
color: #333;