Skip to content

Instantly share code, notes, and snippets.

View scjudd's full-sized avatar

Spencer Judd scjudd

View GitHub Profile
@scjudd
scjudd / crc32.rs
Last active August 29, 2015 14:21
CRC-32 implementation in Rust
/*
const CRC32_IEEE: u32 = 0xedb88320;
fn crc32_table(poly: u32) -> [u32; 256] {
let mut table = [0u32; 256];
for i in 0..table.len() {
let mut val = i as u32;
for _ in 0..8 {
val = if val&1 == 1 {
(val >> 1) ^ poly
@scjudd
scjudd / gist:9a2e0bdbe19bea46bb3c
Created January 6, 2015 15:59
vim scratchpad write to clipboard
:nnoremap ZZ :silent w !xclip<enter>
@scjudd
scjudd / macmini4,1_archlinux.md
Created May 3, 2012 18:23
MacMini4,1 Arch Linux Install Guide

Install Arch Linux on a MacMini4,1

  1. Boot into OS X

  2. In Disk Utility, make space for Arch partition

  3. Boot Arch Linux install with 'nomodeset' boot option

  4. Install gptfdisk (provides cgdisk)

@scjudd
scjudd / gradient.css
Created October 24, 2011 20:42
cross-browser gradient
background: -webkit-gradient(linear, left top, left bottom, from(#254080), to(#1d3366));
background: -moz-linear-gradient(top, #254080,#1d3366);
background: filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#254080', endColorstr='#1d3366');
/* with color stops.. */
background: -webkit-gradient(linear, left top, left bottom, from(#7F87C6), color-stop(20%, #2239A1));
background: -moz-linear-gradient(left top, left bottom, from(#7F87C6), color-stop(20%, #2239A1));
@scjudd
scjudd / redirect.php
Created October 8, 2011 20:15
php redirect
<?php
header("Location: http://www.yoursite.com/new_page.html");
?>
@scjudd
scjudd / .htaccess
Created April 11, 2011 19:20
enable php error logging
# enable PHP error logging
php_flag log_errors on
php_value error_log ./PHP_errors.log