Skip to content

Instantly share code, notes, and snippets.

@craig552uk
craig552uk / .conkyrc
Created September 23, 2013 15:40
My Conkyrc
# Conky settings #
background no
update_interval 5
double_buffer yes
no_buffers yes
# Window specifications #
own_window yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
@craig552uk
craig552uk / h5bp-main.css
Created September 23, 2013 15:37
H5BP Main CSS
/*! HTML5 Boilerplate v4.3.0 | MIT License | http://h5bp.com/ */
/*
* What follows is the result of much research on cross-browser styling.
* Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
* Kroc Camen, and the H5BP dev community and team.
*/
/* ==========================================================================
Base styles: opinionated defaults
@craig552uk
craig552uk / normalize.css
Last active December 23, 2015 17:59
Normalize CSS
/*! normalize.css v1.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 6/7/8/9 and Firefox 3.
*/
@craig552uk
craig552uk / html5-boilerplate.html
Last active December 23, 2015 17:59
HTML5 Boilerplate
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
@craig552uk
craig552uk / ga_tracking.js
Last active December 20, 2015 08:49
Blog: Extract the Google Analytics Visitor ID from the cookie and push it back to GA as a custom variable.
// Extracts the Visitor ID from a GA cookie
function _goog_id(){
var id, a, c = document.cookie.split('; ');
for(i in c){a = c[i].split('=');if(a[0]=='__utma'){id = a[1].split('.')[1];}}
return id || 'unknown';
}
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXX-X']);
_gaq.push(['_trackPageview']);
@craig552uk
craig552uk / sublime-text-2 config
Last active October 2, 2015 21:58
My Sublime Text 2 Config
{
"color_scheme": "Packages/Color Scheme - Default/Solarized (Dark).tmTheme",
"dictionary": "Packages/Language - English/en_GB.dic",
"file_exclude_patterns":
[
"*.pyc",
"*.pyo",
"*.exe",
"*.dll",
"*.obj",
@craig552uk
craig552uk / http_exceptions.py
Created October 21, 2014 09:51
A set of HTTP Exceptions for use in Request Handlers
# -*- coding: utf-8 -*-
#
# Author: Craig Russell <craig@craig-russell.co.uk>
# Simple exceptions for HTTP Errors
# http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
#
# Example:
#
# try:
# raise BadRequest()
@craig552uk
craig552uk / netwk.py
Created September 12, 2014 08:38
A netcat type thing in python
#
# > telnet localhost 4000
# Trying 127.0.0.1...
# Connected to localhost.
# Escape character is '^]'.
# hello
# world
#
# Connection closed by foreign host.
@craig552uk
craig552uk / kis_link_checker.py
Last active August 29, 2015 14:03
KIS Widget Checker