Skip to content

Instantly share code, notes, and snippets.

View kzrl's full-sized avatar

Karl Cordes kzrl

View GitHub Profile
package main
import (
"fmt"
"strconv"
"time"
"github.com/tarm/serial"
)
@kzrl
kzrl / dyndns_route53.py
Created July 22, 2016 09:41 — forked from mariocesar/dyndns_route53.py
Update a Route53 Record if your public IP changes. Like DynDNS
"""
Requeriments:
$ sudo pip install boto dnspython
Edit ~/.boto to use your AWS credentials
"""
import time
import sys
@kzrl
kzrl / gist:7207234
Created October 29, 2013 00:27
Find words that end in 'cat'. Then, count them. Quick demo of the power of the command line.
$ grep cat$ /usr/share/dict/words
bobcat
cat
Chilcat
copycat
crazycat
ducat
gaycat
hellcat
hellicat
@kzrl
kzrl / test.php
Created October 3, 2013 08:02
PHP Infusionsoft SDK - very slow initialization
<?php
// Infusionsoft Domain for connection
define('INFUSIONSOFT_DOMAIN', 'zhXXX');
define('INFUSIONSOFT_KEY', 'XXXXXXXXXXXXXXXXXXXXXX');
// get the isdk and other required files
require_once 'lib/iSDK-new/src/isdk.php';
@kzrl
kzrl / darkside.js
Created September 23, 2013 13:11
Dark Side of the Moon cover in a tiny amount of JS Originally from http://jsfiddle.net/qLfYS/
var c=document.getElementById("d");
var c=c.getContext("2d");
var L2=[0,425,338,332,402,225,542,465,262,465,402,225,460,315,800,378];
var cs=["fff","f00","ffa500","ff0","0f0","00f","800080"];
for(var i=2,j=0;i<26;){
c.beginPath();
c.lineWidth=i==2||i>=12?8:2;
var k=Math.floor(i/12)*(i%12-2);
if(k<0)k=10;
@kzrl
kzrl / .i3status.conf
Created August 29, 2013 04:22
i3 configs
general {
colors = true
interval = 5
}
#order += "ipv6"
order += "disk /"
#order += "run_watch DHCP"
#order += "run_watch VPN"
#order += "wireless wlan0"
@kzrl
kzrl / gist:6019785
Created July 17, 2013 11:46
Neat breakpoints for media() queries
// Breakpoints.
$desktop: new-breakpoint( min-width 960px 12 );
$tablet: new-breakpoint( min-width 768px max-width 959px 12 );
$mobile: new-breakpoint( max-width 767px 12 );
$handheld: new-breakpoint( max-width 959px 12 );
@kzrl
kzrl / nodemail.js
Created April 19, 2013 07:51
Nodemail example
var Imap = require('imap'),
inspect = require('util').inspect;
var imap = new Imap({
user: '',
password: '',
host: 'imap.gmail.com',
port: 993,
secure: true
});
@kzrl
kzrl / wordpress-admin.php
Created November 29, 2012 21:52
AJAX autocomplete on wordpress admin pages
<?php /* From http://sudarmuthu.com/blog/using-wordpress-built-in-tag-auto-complete-script-in-your-plugins */ ?>
<?php
// Register hooks
add_action('admin_print_scripts', 'add_script');
add_action('admin_head', 'add_script_config');
/**
* Add script to admin page
@kzrl
kzrl / css3-speech-bubble.html
Created November 29, 2012 10:41
CSS3 speech bubble
<html>
<head>
</head>
<body>
<style>
/* ============================================================================================================================
== BUBBLE WITH A BORDER AND TRIANGLE
** ============================================================================================================================ */