Skip to content

Instantly share code, notes, and snippets.

View justinAurand's full-sized avatar
👋
Probably coding...

Justin Aurand justinAurand

👋
Probably coding...
View GitHub Profile
@justinAurand
justinAurand / OrderItemsRandomlyByWeight.cs
Last active May 1, 2020 17:48
Order items randomly by weight
using System;
using System.Collections.Generic;
using System.Linq;
public class Program
{
public void Main()
{
var items = new List<WeightedItem> {
new WeightedItem { Name = "Chicken", Weight = 1 },
@justinAurand
justinAurand / style.qss
Last active March 7, 2019 17:41
Double the size of the Modern skin for Launchy
/*
Almost necessary for 4K monitors.
Credit - https://www.deviantart.com/handofra--/art/Modern-for-Launchy-368677286
*/
/* Base */
#launchy {
background-color: #161616;
qproperty-geometry: rect(0 0 880 280);
}
@justinAurand
justinAurand / pageant_autostart.cmd
Last active September 11, 2020 11:04 — forked from teleivo/pageant_autostart.cmd
Run pageant and add keys on Cmder startup
setlocal ENABLEDELAYEDEXPANSION
set ssh_key_home=%HOME%\.ssh\
set pageant_key_wildcard=*.ppk
echo Gathering keys matching %pageant_key_wildcard% in ^
%ssh_key_home%
rem Check if pageant is running
for /f "tokens=2 delims=," %%F in ('tasklist /nh /fi "imagename eq PAGEANT.EXE" /fo csv') do (
@justinAurand
justinAurand / PhillyEte2017.txt
Last active April 19, 2017 22:37
Notes from Philly ETE 2017
React Native
- Uses the component model, which means no finding elements
- Has both live and hot reload. Hot reload maintains state
- You can *skip* the app store process. Build the .jsbundle locally, deploy to OTA users, and user apps update on the spot
The Scaling Myth
- The Tyranny of Structurelessness -> look it up
- Conway's Law - Code org/structure ends up resembling team org/structure
C#/F# .NET Core
@justinAurand
justinAurand / WorkflowRunner.cs
Created March 30, 2017 19:38
Getting a workflow runner from a service.
namespace WorkflowActions
{
using System;
internal class Program
{
private static void Main()
{
const string workflowName = "Ftp";
@justinAurand
justinAurand / CodeCampAngular1and2.txt
Last active March 1, 2017 15:04
Notes from Philly.NET Code Camp session on Angular 2017-02-24
Code Camp Notes
- Angular vs React -> Bill Wolff (speaker) beliefs
- Angular is better at forms over data for business apps
- React can be faster when utilized correctly
- Wanna see Google search trends? https://trends.google.com/trends/
- SmarterASP.net (hosting provider) sucks
- They no longer have phone support
import java.util.function.Predicate;
import java.util.HashMap;
public class DefuseBomb {
private HashMap<Wire, Predicate<Wire>> explosiveWireCutSequences =
new HashMap<Wire, Predicate<Wire>>();
private enum Wire { white, black, purple, red, green, orange };
public DefuseBomb(String[] wireCuts) {
setExplosiveWireCutSequences();
@justinAurand
justinAurand / Cs60NewFeatures.cs
Created January 21, 2016 01:15
C# 6.0 new features in a fairly simple C# file.
// C#6 feature: Auto-property Initializer
public Guid Id { get; private set; } = Guid.NewGuid();
// C#6 feature: Auto-property Initializer (Getter only)
public Guid Id { get; } = Guid.NewGuid();
// C#6 feature: String Interpolation
string test = $"{this.FirstName} {this.LastName} ({this.Id})";
FormattableString test2 = $"{this.FirstName} {this.LastName} ({this.Id})";
Console.WriteLine(test2.ArgumentCount + " " + test2.Format);
@justinAurand
justinAurand / Module.html
Last active August 29, 2015 14:13
Scoping using a JavaScript module.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Module</title>
</head>
<body>
<div id="messenger">null</div>
</body>
@justinAurand
justinAurand / RecordParser.cs
Created November 11, 2014 16:24
Parse a fixed width record.
using System.Collections.Generic;
using System.Linq;
using System.Text;
internal static class RecordParser
{
/// <summary>
/// Parses a fixed width record on the endpoints supplied.
/// </summary>
/// <param name="record">The fixed width record to parse</param>