Skip to content

Instantly share code, notes, and snippets.

@kitroed
kitroed / FoxProReader.cs
Created March 3, 2011 15:47
Use OleDb to parse the conents of certain FoxPro files
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Data;
using System.Data.OleDb;
using System.Text.RegularExpressions;
@kitroed
kitroed / .gvimrc
Last active April 28, 2016 17:15
my work .gvimrc file
set colorcolumn=85
:imap <C-BS> <C-W>
"call pathogen#runtime_append_all_bundles()
syntax enable
colorscheme desert
set background=dark
colorscheme solarized
"match Todo /\s\+$/ " highlight trailing whitespace
"tab keyboard shortcuts
nnoremap <C-N> :tabnew<CR>
@kitroed
kitroed / PowershellScriptExecutionDemo.cs
Created April 26, 2011 12:49
Originally put together Sept. 2010 demonstrating the ability to run PowerShell scripts from C#
using System;
using System.Collections.ObjectModel;
using System.Management.Automation;
using System.Management.Automation.Runspaces;
using System.Text;
// Build Command:
// C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe PowerShellScriptExecutionDemo.cs /reference:C:\Windows\assembly\GAC_MSIL\System.Management.Automation\1.0.0.0__31bf3856ad364e35\System.Management.Automation.dll
namespace PowerShellScriptExecutionDemo
@kitroed
kitroed / gist:1246916
Created September 28, 2011 03:24
Rival Rockets Tumblr theme source
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
{block:Description}<meta name="description" content="{MetaDescription}" />{/block:Description}
<meta name="if:Show Title in Topbar" content="1" />
<meta name="if:Show Title in Header" content="1" />
<meta name="if:Show Home Link" content="1" />
<meta name="if:Show Description in Header" content="1" />
@kitroed
kitroed / arduino.pde
Created February 3, 2012 13:48 — forked from bmorton/arduino.pde
Arduino Experiment
/*
* Set LED brightness by serial write
* An Arduino experiment
* by Brian Morton
*/
int ledPin = 9;
int brightness = 0;
void setup() {
@kitroed
kitroed / GenerateSqlScripts.ps1
Last active December 23, 2022 22:28
Generate a file-per-object representation of a given SQL Server database using PowerShell and SMO.
# Adapted from http://www.simple-talk.com/sql/database-administration/automated-script-generation-with-powershell-and-smo/
<#
.SYNOPSIS
Generate file-per-object scripts of specified server and database.
.DESCRIPTION
Generate file-per-object scripts of specified server and database to specified directory. Attempts to create specified directory if not found.
.PARAMETER ServerName
@kitroed
kitroed / caps.reg
Created September 26, 2012 15:01
Windows Registry hack to remap the caps lock key to the "super" key/Windows logo key.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,5c,e0,3a,00,00,00,00,00
@kitroed
kitroed / gettimestamp.prg
Created October 23, 2012 14:10
Translate a standard FoxPro datetime timestamp to a FOX system file timestamp.
PROCEDURE GetTimeStamp
#define DEBUGGING .F.
*=======================================================
* GetTimeStamp( vDateTime )
*
* Returns a FOX system file timestamp
* from a date time value, any data type
*
* Calls: intToBin(), binToInt() defined below.
*=======================================================
@kitroed
kitroed / StartSqlServerServices.ps1
Created November 21, 2012 15:49
Start MSSQL (Full) Services with PowerShell script.
Start-Service -DisplayName "SQL Server (MSSQLSERVER)"
Start-Service -DisplayName "SQL Server Browser"
Start-Service -DisplayName "SQL Server Agent (MSSQLSERVER)"
declare @table1 table (date_field date, value_field varchar(25))
insert into @table1 (date_field, value_field) values
('4/1/2012', 'intial value 1'),
('4/2/2012', 'intial value 2'),
('4/3/2012', 'intial value 3'),
('4/4/2012', 'intial value 4')
select * from @table1