Skip to content

Instantly share code, notes, and snippets.

@kitroed
kitroed / easy162.py
Created May 27, 2014 06:10
r/dailyprogrammer (Easy): Novel Compression, pt. 1: Unpacking the Data
# daily programmer #162 easy "Novel Compression pt. 1: Unpacking the Data"
# author: Kit Roed
# example dictionary:
#
# is
# my
# hello
# name
# stan
@kitroed
kitroed / easy163.py
Last active August 29, 2015 14:01
r/dailyprogrammer challenge number 163 "easy" - Probability Distribution of a 6 Sided Di
# r/dailyprogrammer challenge number 163 "easy"
# Probability Distribution of a 6 Sided Di
# Author: Kit Roed
# Language: python3
#make python random do all the work
import random
dsize = 6
roll_counts = []
@kitroed
kitroed / QueryForDuplicateFilesLinq.cs
Created January 27, 2014 19:33
Query for Duplicate Files LINQ
void Main()
{
// Uncomment QueryDuplicates2 to run that query.
// QueryDuplicates();
QueryDuplicates2();
// Keep the console window open in debug mode.
// Console.WriteLine("Press any key to exit.");
// Console.ReadKey();
}
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
@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)"
@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 / 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 / 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 / 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 / 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" />