Skip to content

Instantly share code, notes, and snippets.

View bmatzelle's full-sized avatar

Brent Matzelle bmatzelle

View GitHub Profile
@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 / 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 / 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: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 / 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 / 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 / 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]) +
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 / Sql_Server_backup_to_disk.sql
Created February 19, 2014 16:38
Example of how to backup a table with SQL for SQL Server
DECLARE @dbName varchar(1000);
DECLARE @exportPath varchar(1000);
SET @exportPath = 'C:\Database_Backups';
SET @dbName = 'YourDatabase';
-- Backs up data in the format: "[DB_name]_YYYY.MM.DD.bak"
SET @exportPath = @exportPath + '\' + @dbName + '_' +
(SELECT CONVERT(VARCHAR(12), GETDATE(), 102)) + '.bak';
@bmatzelle
bmatzelle / SQL_Server_List_All_Foreign_Keys.sql
Created April 1, 2014 00:51
Lists all foreign keys in an MS SQL Server database
-- Lists all foreign keys in an MS SQL Server database
-- Grabbed from here:
-- http://lostechies.com/jimmybogard/2008/11/27/viewing-all-foreign-key-constraints-in-sql-server/
SELECT
f.name AS ForeignKey,
OBJECT_NAME(f.parent_object_id) AS TableName,
COL_NAME(fc.parent_object_id, fc.parent_column_id) AS ColumnName,
OBJECT_NAME (f.referenced_object_id) AS ReferenceTableName,
COL_NAME(fc.referenced_object_id, fc.referenced_column_id) AS ReferenceColumnName
FROM