Skip to content

Instantly share code, notes, and snippets.

View v2keener's full-sized avatar

Gustavo (Keener) DeLaFuerza v2keener

View GitHub Profile
@v2keener
v2keener / tfs-open-work-items.ps1
Last active August 29, 2015 13:57
Viewing Open Work Items, TFS via PowerShell
<#
Taken from Julian Kay's Blog:
http://juliankay.com/development/querying-tfs-with-tfpt-exe-and-powershell/
#>
$TFSSERVER = "hq-tfs08-01.branded3.net"
@v2keener
v2keener / work-hours-from-tfs.ps1
Created March 4, 2014 14:10
Retrieve Work Hours from TFS with PowerShell
<#
Taken from Julian Kay's Blog
http://juliankay.com/development/querying-tfs-with-tfpt-exe-and-powershell/
#>
Function Get-WorkItemHours
{
$month = (Get-Date).ToString("MMMM")
@v2keener
v2keener / .vimrc
Created April 10, 2014 16:19 — forked from JeffreyWay/.vimrc
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
# Mac OS X Lion introduced a new, iOS-like context menu when you press and hold a key
# that enables you to choose a character from a menu of options. If you are on Lion
# try it by pressing and holding down 'e' in any app that uses the default NSTextField
# for input.
#
# It's a nice feature and continues the blending of Mac OS X and iOS features. However,
# it's a nightmare to deal with in Sublime Text if you're running Vintage (Vim) mode,
# as it means you cannot press and hold h/j/k/l to move through your file. You have
# to repeatedly press the keys to navigate.
object SumDigits {
def main(args: Array[String]) {
println("heelo [sic] world");
sumDigits(94); //13
sumDigits(32); //5
sumDigits(44); //8
sumDigits(5232); //12
sumDigits(3535235); //26
sumDigits(2147483647); //46 (Int [31 bit + 1 bit for sign] max value)
}
@v2keener
v2keener / SumDigitsMeta.scala
Created September 20, 2014 01:41
SumDigits, only more meta.
object SumDigits {
def maxInt = 2147483647
def printResult(arg: Int){
printResult(arg, sumDigits(arg));
}
def printResult(arg: Int, result: Int){
printf("Sum of %d is %d\n", arg, result);
}
@v2keener
v2keener / onOffTest.ino
Created October 6, 2014 20:26
Arduino Off/On switch via semaphore
// This bitty program allows me to have a simple push button operate as if it were a toggle switch
int switchState = 0;
boolean isOn = true; // state of pin 3
boolean isFirstLoop = true; // mutex
void setup(){
// Set pins 2 and 3 to OUTPUT
for(int x = 2; x <=3; ++x){
/*
I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace
so it's better encapsulated. Now you can have multiple random number generators
and they won't stomp all over eachother's state.
If you want to use this as a substitute for Math.random(), use the random()
method like so:
var m = new MersenneTwister();
@v2keener
v2keener / bit.fs
Last active August 29, 2015 14:08
(*
This is a command-line app that allows you to type whatever you want and get [Yes|No|[Maybe]] as an answer.
It also creates log files, one for each day, and one for each month.
This file compiles with:
fsc.exe bit.fs --standalone
<h1>This page is meant to redirect you to Gustavo Keener's new site,</h1>
<h1 style="padding-left: 25%;"><a href="http://www.keenerweb.com">KeenerWeb™</a></h1>
<h1>in <span id="number">8</span> seconds<span id="wait">...</span></h1>
<script type="text/javascript">
var span = document.getElementById('wait'), number = document.getElementById('number');
var waitStates = ['....', '..', '...'], first = true;
var count = 0, intervalSeconds = 0.5, maxSeconds = 8, intervalsPerSecond = (1 / intervalSeconds), maxCount = (maxSeconds * intervalsPerSecond);
var interval = window.setInterval(function () {
if (count >= maxCount) {
window.clearInterval(interval);