Skip to content

Instantly share code, notes, and snippets.

View bmatzelle's full-sized avatar

Brent Matzelle bmatzelle

View GitHub Profile
Folder PATH listing
Volume serial number is E00C-A166
C:\PROGRAM FILES (X86)\GIT
| Git Bash.lnk
| Git Bash.vbs
| ReleaseNotes.rtf
| unins000.dat
| unins000.exe
|
+---bin
@bmatzelle
bmatzelle / routing_number_check_sum.rb
Created May 2, 2013 14:13
Ruby routing number check sum function
# Ruby routing number check sum function. Code adapted from Wikipedia Python
# example: http://en.wikipedia.org/wiki/Routing_transit_number
# Returns true if a routing number string check sum is valid.
def routing_number_check_sum(number)
d = []
number.each_char { |char| d << char.to_i }
d[8] == (7 * (d[0] + d[3] + d[6]) +
3 * (d[1] + d[4] + d[7]) +
@bmatzelle
bmatzelle / Nini_Write_File.cs
Created February 22, 2012 01:11
Writes an INI file using Nini
/*
Shows an example of Nini's IniDocument class to write an INI file. The example below
will write the following INI file "configuration.ini":
[Cars]
model = Toyota
year = 2012
*/
Nini.Ini.IniDocument doc = new Nini.Ini.IniDocument();
@bmatzelle
bmatzelle / gist:1880345
Created February 22, 2012 01:07
Reading INI file with Nini
/*
Shows an example of Nini's IniDocument class to read an INI file.
Example configuration.ini file:
[Cars]
model = Toyota
year = 2012
*/
@bmatzelle
bmatzelle / gist:245561
Created November 30, 2009 17:12
Vuzit on page changed example
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Vuzit onPageChanged Example</title>
<link href="http://vuzit.com/stylesheets/Vuzit-2.9.css" rel="Stylesheet" type="text/css" />
<script src="http://vuzit.com/javascripts/Vuzit-2.9.js" type="text/javascript"></script>
@bmatzelle
bmatzelle / FogBugz 7 MySQL Export Primary Key and Index Fix Script.sql
Created November 18, 2009 18:13
Fixes teh FogBugz 7 MySQL primary key export
-- FogBugz 7 MySQL Export Primary Key and Index Fix Script
--
-- The FogBugz 7 MySQL data export does not create a database with the primary
-- keys created. When the export is imported and you run FogBugz you will
-- see an error like the one below on FogBugz:
--
-- Dynamic SQL generation for the UpdateCommand is not supported against
-- a SelectCommand that does not return any key column information
--
-- Running the script below creates the necessary primary keys and also removes
@bmatzelle
bmatzelle / gist:173337
Created August 23, 2009 15:54
Vuzit on page changed example
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Vuzit On Page Changed Example</title>
<link href="http://vuzit.com/stylesheets/Vuzit-2.7.css" rel="Stylesheet" type="text/css" />
<script src="http://vuzit.com/javascripts/Vuzit-2.7.js" type="text/javascript"></script>
<script type="text/javascript">
@bmatzelle
bmatzelle / gist:169277
Created August 17, 2009 18:01
Vuzit full screen example snippet
<script type="text/javascript">
// Once the page is loaded call this.
function pageLoaded() {
// Replace with your public key
vuzit.Base.apiKeySet("YOUR_PUBLIC_KEY");
// Replace with the document you are loading
var viewer = vuzit.Viewer.fromId("DOCUMENT_ID");
viewer.display(document.getElementById("viewer"), { zoom: 1, showFullScreen: true });
@bmatzelle
bmatzelle / python_django_template_example.html
Created December 17, 2014 16:51
Python Django template example
<html>
<head>
<link href="https://ssl.vuzit.com/stylesheets/Vuzit-2.10.css" rel="Stylesheet" type="text/css" />
<script src="https://ssl.vuzit.com/javascripts/Vuzit-2.10.js" type="text/javascript"></script>
<script type="text/javascript">
// Called when the page is loaded.
function initialize() {
vuzit.Base.apiKeySet("{{public_key}}");
var options = {signature: '{{signature}}',
@bmatzelle
bmatzelle / vuzit_django_signature_example.py
Last active August 29, 2015 14:11
Python Django Vuzit signature example
import time
import sha
import hmac
import base64
# Add your client settings here
public_key = '<YOUR PUBLIC KEY>'
private_key = '<YOUR PRIVATE KEY>'
# View a document