Skip to content

Instantly share code, notes, and snippets.

View JeremyMorgan's full-sized avatar

Jeremy Morgan JeremyMorgan

View GitHub Profile
@JeremyMorgan
JeremyMorgan / msbuild.txt
Created April 25, 2015 20:26
MSBUILD Properties - The full list
------------------------------ Environment -------------------------------
ALLUSERSPROFILE
APPDATA
AppsRoot
CommonProgramFiles
CommonProgramFiles(x86)
CommonProgramW6432
COMPUTERNAME
ComSpec
@JeremyMorgan
JeremyMorgan / properties.cs
Created April 16, 2015 18:18
Typical property accessors
private string _name;
public string Name
{
get { return _name; }
set
{
if(!String.IsNullOrEmpty(value))
{
_name = value;
@JeremyMorgan
JeremyMorgan / twosum.cs
Created March 23, 2015 22:29
TwoSum in C#
using System;
using System.Diagnostics;
namespace TwoSum
{
internal class Program
{
public static Tuple<int, int> TwoSum(int[] numbers, int target)
{
var lengthOfNumbers = numbers.Length;
@JeremyMorgan
JeremyMorgan / twosum2.cpp
Created December 30, 2014 07:18
Another twosum attempt
#include <iostream>
#include <vector>
#include <string>
using namespace std;
/*
Input: numbers={2, 7, 11, 15}, target=9
Output: index1=1, index2=2
*/
@JeremyMorgan
JeremyMorgan / twosum.cpp
Last active August 29, 2015 14:12
Two Sum Problem (Subset Sum Problem or Modified Knapsack)
#include <iostream>
#include <vector>
#include <string>
using namespace std;
/*
Input: numbers={2, 7, 11, 15}, target=9
Output: index1=1, index2=2
*/
@JeremyMorgan
JeremyMorgan / excel.cpp
Last active August 29, 2015 14:12
Excel Sheet Problem
/*
Given a positive integer, return its corresponding column title as appear in an Excel sheet.
For example:
1 -> A
2 -> B
3 -> C
...
26 -> Z
@JeremyMorgan
JeremyMorgan / longlat.cs
Created November 24, 2014 04:50
Code to grab long/lat from wccca page
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HtmlAgilityPack;
namespace ConsoleTester
{
class Program
// display your IP address, useful when launching VMs
echo 'Your IP:'
ip addr show dev eth0 | sed -nr 's/.*inet ([^ ]+).*/\1/p' | cut -f1 -d'/'
@JeremyMorgan
JeremyMorgan / shake.go
Last active January 16, 2025 20:12
The most important code I've ever written
package main
import (
"fmt";
)
func loopit(phrase string, repeat int)(string){
var outputphrase string = "";
@JeremyMorgan
JeremyMorgan / helloworld.cbl
Created October 15, 2014 19:23
Hello world cobol
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
PROCEDURE DIVISION.
DISPLAY 'Hello world!'.
STOP RUN.