Skip to content

Instantly share code, notes, and snippets.

View ilmaestro's full-sized avatar

Ryan Kilkenny ilmaestro

  • Portland, OR
View GitHub Profile
@ilmaestro
ilmaestro / BatsBunker.fs
Created June 6, 2017 18:36
My solution to the CheckIO bats bunker problem in F#. A long time ago this problem plagued me when i first attempted it in Python. I enjoyed the re-attempt.
namespace DailyCode
module Geometry =
// 2d point class
type Point2d (x, y) =
member this.X = x
member this.Y = y
override this.ToString() = sprintf "(%f, %f)" this.X this.Y
static member (+) (a : Point2d, b : Point2d) = Point2d (a.X + b.X, a.Y + b.Y)
@ilmaestro
ilmaestro / player_movement.gml
Created October 15, 2016 19:44
gamemaker player movement script
/// Player movement script
/// arg0 = velocity
/// should be called in a step
{
// Local vars & args
velocity = argument[0];
xVel = 0;
yVel = 0;
// check keyboard events
@ilmaestro
ilmaestro / AppSettingHelper.fs
Last active September 14, 2016 15:07
Safely get AppSettings with default values
let tryBoxOperation operation (item: string) =
try
Some (box (operation(item)))
with
| _ -> None
let getAppSetting (key: string) defaultValue =
let tryConvert =
match box defaultValue with
| :? bool -> tryBoxOperation System.Convert.ToBoolean
@ilmaestro
ilmaestro / AquaLight.pde
Created December 13, 2014 04:09
Arduino LED Saltwater Light
/*****
AquaLight - Versin 2.0 (rewritten after accidentally deleting my project after a year)
Ryan Kilkenny - 12/26/2010
basic functions:
* RTC - timing functions
* Serial LCD - Clock Display, future menu system
* PWM - LED light control
program
@ilmaestro
ilmaestro / GenerateImports.biml
Created December 13, 2014 04:00
SSIS Import Generation
<#@ template language="C#" tier="0" #>
<#@ import namespace="System.Data"#>
<#@ import namespace="System.Data.SqlClient"#>
<#@ import namespace="System.IO"#>
<Biml xmlns="http://schemas.varigence.com/biml.xsd">
<#
/* Declare variables */
string MetadataConnection = "Server=CLNZ-SqlStage\\ENERGYSERVICES;Initial Catalog=EMV_AR_dev_DC;Integrated Security=SSPI;Provider=SQLNCLI11.1"; // The connection string to the metadata database. This is hardcoded.
string serverName = @"CLNZ-SQLSTAGE\ENERGYSERVICES";
@ilmaestro
ilmaestro / ShowerContoller.pde
Created October 12, 2014 23:06
Arduino Shower Controller
/*
Shower Contoller
8/9/2010 - Ryan Kilkenny
features:
-relays to control two valves and a pump (main & recirculation)
* digital pins 13,12,11
-thermistor to detect temp of hot water pipe
-hall effect sensor to detect when soap is in use
' QBasic Modem Wars Program
' Ryan Kilkenny
' 9/29/1997
DECLARE SUB p2check ()
DECLARE SUB p2path ()
DECLARE SUB p2fire ()
DECLARE SUB p2up ()
DECLARE SUB p2right ()
DECLARE SUB p2left ()
;********************************************************************
;********************************************************************
;***** Author: Ryan Kilkenny *************
;***** Project: Senior Project *************
;***** Title: MIDI Controlled Analog Synthesizer *************
;***** Date: November 02, 2001 *************
;********************************************************************
;********************************************************************
;***** MIDI receiver and converter that will control *************
;***** an analog synthesizer through a D/A converter *************