Skip to content

Instantly share code, notes, and snippets.

View seabre's full-sized avatar

Sean Brewer seabre

  • CrowdFiber
  • Chattanooga, TN
View GitHub Profile
@seabre
seabre / basic_html5_template.html
Created October 15, 2011 07:58
Basic HTML5 Template
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Basic HTML5 Template</title>
<link href="stylesheets/style.css" rel="stylesheet" type="text/css" media="screen" />
<script src="example.js"></script>
</head>
<body>
@seabre
seabre / compressallpng.sh
Created October 17, 2011 16:44
Crush All PNGs Starting From Root Directory.
#!/bin/bash
(find . -name "*.png")|while read pngfile
do
PNG_FILE=$pngfile
PNG_TMP=$RANDOM.compressallpng.png
pngcrush -brute $PNG_FILE $PNG_TMP
mv $PNG_TMP $PNG_FILE
done
@seabre
seabre / lighttpd.conf
Created November 4, 2011 15:53
lighttpd PHP Demo Server Configuration
# I needed a way to quickly test PHP stuff without setting it up somewhere in Apache.
# This works great. You can keep this in your repo and whenever you want to run your code do:
# lighttpd -f lighttpd.conf
# from the root and off you go.
server.bind = "0.0.0.0"
server.port = 8000
server.document-root = CWD
server.errorlog = CWD + "/logs/lighttpd.error.log"
accesslog.filename = CWD + "/logs/lighttpd.access.log"
@seabre
seabre / cur_time_sql.rb
Created December 7, 2011 19:58
Format Time in Ruby for SQL Datetime Comparison
#Gets current time, then formats current time for SQL.
Time.now.to_s(:db)
@seabre
seabre / passenger_standalone_production.sh
Created December 15, 2011 21:42
Start Passenger Standalone in Production Mode
#For some reason, this took forever to figure out...
passenger start -a 127.0.0.1 -p 3000 -d -e production
@seabre
seabre / ti_chronos_watch.pde
Created January 19, 2012 19:52
Connect TI Chronos Watch WIth Processing
/*
Get acceleration data from Chronos watch.
Taken from info posted at: http://e2e.ti.com/support/microcontrollers/msp43016-bit_ultra-low_power_mcus/f/166/t/32714.aspx
Based off of the latest Python code on the Chronos wiki that I wrote.
Copyright (c) 2010 Sean Brewer
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@seabre
seabre / gist:1664683
Created January 23, 2012 18:29
Dump and Restore MySQL Database

#Dump and Restore MySQL DB Quick Ref

##Dump The MySQL Table

mysqldump -u username -p -r my_output.sql my_database

##Compress Output with 7zip using the PPMd Algorithm

7z a -t7z my_output.7z my_output.sql -m0=PPMd

@seabre
seabre / mail_config.rb
Created March 2, 2012 19:54
Mail Configuration for Clients using OpenSRS Mail in Rails
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "mail.our_clients_domain.com",
:port => 25,
:domain => 'our_clients_domain.com',
:user_name => 'whatever_system_user_we_chose@our_clients_domain.com',
:password => 'this_should_be_a_relatively_good_password',
:authentication => 'plain',
#:enable_starttls_auto => false
}
@seabre
seabre / prices.tex
Created March 6, 2012 04:10
Price List For My Mom's Salon
\documentclass[12pt]{article}
\usepackage{sectsty}
\usepackage{fullpage}
\usepackage[light,math]{kurier}
\usepackage[T1]{fontenc}
\begin{document}
\thispagestyle{empty}
@seabre
seabre / binary_ruby.txt
Created March 28, 2012 17:46
Weird Number Binary Thing in Ruby
> 5[0]
=> 1
> 5[1]
=> 0
> 5[2]
=> 1
> 5[3]
=> 0