Skip to content

Instantly share code, notes, and snippets.

View CalvinRodo's full-sized avatar

Calvin Rodo CalvinRodo

View GitHub Profile
@CalvinRodo
CalvinRodo / Database.c#
Created May 11, 2012 15:01
Some code for calling stored procs in c# with oracle.
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Oracle.DataAccess.Client;
using System.Diagnostics;
namespace DataBase
{
@CalvinRodo
CalvinRodo / CoalesceExtension.vb
Created April 25, 2012 19:33
A vb.net Coalesce Extension should be strictly typed.
Imports System.Runtime.CompilerServices
<Extension()>
Public Module GenericExtensions
Function Coalesce(Of T)(first As T, second As T) As T
If (first Is Nothing) Then
Return second
End If
Return first
End Function
@CalvinRodo
CalvinRodo / gist:2407834
Created April 17, 2012 17:57
State Selector
Dim states as Dictionary(Of String, String)() From { {"CA", "California"} }
'to get the name just call where stateCode is the inputted string from the user.
Dim name as String = states(_stateCode)
@CalvinRodo
CalvinRodo / Piglatin
Created April 4, 2012 19:59 — forked from anonymous/Piglatin
Take word, decide if first letter is capitalized, a vowel, and if the word has any vowels.
#include <iostream>
#include <ctime>
#include <ctype.h>
using namespace std;
const int wordSIZE = 50;
void checkVowel(char word[], int size, bool &first_VOWEL, bool &first_CAP, bool &VOWEL );
int arrayLength(char[]);
@CalvinRodo
CalvinRodo / ImprovedPowershellLoading.ps1
Created January 19, 2012 18:19
Improved Module Loading in Windows Powershell profile.
#Add the profile path to the environment path variable
$ProfileRoot = (Split-Path -Parent $MyInvocation.MyCommand.Path)
$env:path = ";$ProfileRoot"
#Load all of the modules from ./Modules/* that aren't already loaded.
(gci $ProfileRoot"/Modules") | ForEach { if ( -Not( Get-Module $_.Name ) ) { Import-Module $_.Name; Write-Host Importing Module: $_.Name } }