Skip to content

Instantly share code, notes, and snippets.

View JossWhittle's full-sized avatar
😸

Joss Whittle JossWhittle

😸
View GitHub Profile
@JossWhittle
JossWhittle / DNListRenderer.java
Created July 6, 2012 18:23
Source Code for Course-Selector
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import javax.swing.JList;
import javax.swing.JPanel;
@JossWhittle
JossWhittle / script_builder.php
Created July 7, 2012 23:51
A PHP function for simultaneously building 'flat' (hardcoded) RSS, Atom, and Sitemap XMLs...
<?php
// Called after an insertion or update to the `posts` table
// Returns void
function writeScripts() {
$atom_date = getDateRFC(getD()); // Current Date 3339 for Atom feed
$site_date = getDateSite(getD()); // Current Date YYYY-MM-DD for Sitemap
// Beginning of Atom.xml
$atom_str = '<feed xml:lang="en-US" xmlns="http://www.w3.org/2005/Atom">
@JossWhittle
JossWhittle / Main.less
Created July 10, 2012 01:54
An example of a Controller script...
// Main.css Controller
@import "shared/mix.less";
@import "shared/vars.less";
@import "shared/font.less";
@import "shared/reset.less";
@import "main/styles.less";
@import "shared/styles.less";
@import "shared/buttons.less";
@import "shared/page.less";
@JossWhittle
JossWhittle / linker.js
Created July 14, 2012 15:11
Chrome Extension Script to convert all title links to open in new tabs. Requires jquery.
// JQuery included here...
// A variable to hold the "timeout-id" for our DOM check
var update;
// Page is ready
$(document).ready(function() {
// The DOM (page) was updated
$("body").bind("DOMSubtreeModified", function() {
@JossWhittle
JossWhittle / .htaccess
Created July 17, 2012 13:42
HTACCESS file with URL Rewrite
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^post/([0-9]+)(:?\/[a-zA-Z0-9_]*)?(:?\/.*)?$ /index.php?id=$1
RewriteRule ^post/([a-zA-Z]+)/([0-9]+)(:?\/[a-zA-Z0-9_]*)?(:?\/.*)?$ /index.php?filter=$1&value=$2
@JossWhittle
JossWhittle / Bars.ini
Created July 19, 2012 18:54
Rainmeter Skin
[Rainmeter]
LocalFont="../ext/helveticaneueltprolt.ttf"
Author=Joss Whittle
Update=1000
[Style]
Fontface="HelveticaNeueLT Pro 45 Lt"
Antialias=1
[Variables]
@JossWhittle
JossWhittle / 3-State Beaver.tur
Created July 20, 2012 18:52
A representation of a simple Turing Machine as 5-Tuples and an implied blank tape.
(1,0,1,R,2)
(1,1,1,L,3)
(2,0,1,L,1)
(2,1,1,R,2)
(3,0,1,L,2)
(3,1,1,N,H)
<?php
$src = '../'.$_GET['url'];
$w = $_GET['w'];
$c = $_GET['c'];
if ($c != 1) {
$c = 0;
}
if ($w % 1 == 0)
@JossWhittle
JossWhittle / Font.less
Created July 26, 2012 10:21
A sample of using fontello in a .LESS project
@charset "UTF-8";
@font-face {
font-family: 'groovy';
src: url('/ext/font/groovy.eot');
src: url('/ext/font/groovy.eot?#iefix') format('embedded-opentype'),
url('/ext/font/groovy.woff') format('woff'),
url('/ext/font/groovy.ttf') format('truetype'),
url('/ext/font/groovy.svg#groovy') format('svg');
font-weight: normal; font-style: normal;
@JossWhittle
JossWhittle / Cross browser.less
Created July 28, 2012 01:43
Some cross browser LESS css mixns
.twoStopGrad(@one, @two) {
background: @one; /* Old browsers */
background: -moz-linear-gradient(top, @one 0%, @two 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,@one), color-stop(100%,@two)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, @one 0%,@two 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, @one 0%,@two 100%); /* Opera11.10+ */
background: -ms-linear-gradient(top, @one 0%,@two 100%); /* IE10+ */
filter: ~"progid:DXImageTransform.Microsoft.gradient( startColorstr='@{one}', endColorstr='@{two}',GradientType=0 )"; /* IE6-9 */
background: linear-gradient(top, @one 0%,@two 100%); /* W3C */
}