Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
chillin' like the vanilla shake that I am

Mike Mahon jetstreamin

:octocat:
chillin' like the vanilla shake that I am
View GitHub Profile
View Keybase.md

Keybase proof

I hereby claim:

  • I am jetstreamin on github.
  • I am dysk0n3kt (https://keybase.io/dysk0n3kt) on keybase.
  • I have a public key ASAx8H2rgt-74CDv7SGAuwcWvbA67ooI0WNLhIl6_UHMPwo

To claim this, I am signing this object:

@jetstreamin
jetstreamin / System Design.md
Created May 17, 2020 — forked from vasanthk/System Design.md
System Design Cheatsheet
View System Design.md

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@jetstreamin
jetstreamin / bounce-db.ps1
Created Apr 15, 2020
bounce-db.ps1 - stops sql server services and deletes the mdf/ldf
View bounce-db.ps1
Import-Module SQLPS
$server = New-Object Microsoft.SqlServer.Management.Smo.Server("localhost")
$db = $server.databases["YOURDBNAME"]
if ($db) {
$server.KillAllprocesses("YOURDBNAME")
$db.Drop()
}
@jetstreamin
jetstreamin / WeightedRandomSelection.cs
Created Apr 7, 2020 — forked from develohpanda/WeightedRandomSelection.cs
Weighted Random Selection - a simplified implementation of the solution found at http://programmers.stackexchange.com/a/150642/244423
View WeightedRandomSelection.cs
/// <summary>
/// Selects a random element from input list using the weights on T to sway selection.
/// T must have a Weight property on it.
/// </summary>
public T SelectRandom<T>(List<T> objects)
{
int totalWeight = 0;
T selected = default(T);
foreach (T obj in objects)
{
@jetstreamin
jetstreamin / WeightedRandomSelectionWithLimitedAllocations.cs Weighted Random Selection With Limited Allocations - a modified implementation of the solution found at http://programmers.stackexchange.com/a/150642/244423
View WeightedRandomSelectionWithLimitedAllocations.cs
/// <summary>
/// Selects a random element from input list using the allocations remaining to sway selection
/// T must have AllocationRemaining, Weight and Id properties on it.
/// </summary>
public T SelectRandom<T>(List<T> objects)
{
int totalWeight = 0;
T selected = default(T);
foreach (T obj in objects)
{
@jetstreamin
jetstreamin / delete-sql.ps1
Last active Apr 7, 2020 — forked from develohpanda/delete-sql.ps1
Drop SQL database from Powershell
View delete-sql.ps1
function Delete-SqlDatabase($serverName, $databaseName) {
Import-Module SQLPS
$server = New-Object Microsoft.SqlServer.Management.Smo.Server($serverName)
$db = $server.databases[$databaseName]
if ($db) {
$server.KillAllprocesses($databaseName)
$db.Drop()
}
}
@jetstreamin
jetstreamin / 1585469980.html
Created Mar 29, 2020
Created with Copy to Gist
View 1585469980.html
Inbox from the Trump campaign: "America is under attack – not just by an invisible virus, but by the Chinese."
"What is Joe Biden up to as all this is happening? Siding with the Chinese and attacking the presidential candidate China fears most: Donald Trump."
View setup-web-dev.ps1
# This script is intentionally kept simple to demonstrate basic automation techniques.
Write-Output "You must run this script in an elevated command shell, using 'Run as Administator'"
$title = "Setup Web Development Environment"
$message = "Select the appropriate option to continue (Absolutely NO WARRANTIES or GUARANTEES are provided):"
$yes = New-Object System.Management.Automation.Host.ChoiceDescription "&Install Software using Chocolatey", `
"Setup development environment."
View pinks-purples-color-group.json
{"pinks-purples-color-group":[
{"name":"pink","code":"#ffc0cb"},
{"name":"lightpink","code":"#ffb6c1"},
{"name":"hotpink","code":"#ff69b4"},
{"name":"deeppink","code":"#ff1493"},
{"name":"palevioletred","code":"#db7093"},
{"name":"mediumvioletred","code":"#c71585"},
{"name":"purpl","code":"colors"},
{"name":"lavender","code":"#e6e6fa"},
{"name":"thistle","code":"#d8bfd8"},
@jetstreamin
jetstreamin / m13-io-evil-person.png
Last active Oct 8, 2019
m13-io-evil-person.png
View m13-io-evil-person.png
![image.png](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA0AAAAGKCAYAAAAljyG5AAAgAElEQVR4Aey9WYzl6Xne9/z37Sy1dHX3dM9whhpqSIoUtYsSjFCxAihwgNgSFMH2RS4FZZEQCAKEIEKC5EaRCN0ECGBIyE2AXFkQYMGIAAOGY1gAFcEWI5EURXGZfaa7q6trOef89y34vd+pYWs4XCDudtdMdVWd9X++5V2e93mfz/vU//GHcxSn8qNQYRap7loFs6d1vlRZnktJp6OTQyVhrL6W+imSn6SKlgtFi1y9JqWLQv0wqB0GZUWmMI41joPmeZbneRrH0b7DMFQcx+KL+yRP0zTZ777vv3V7EATi7mka7bZhmuWHvl5++VUdHx3Y43nNNEmURJGGYbDvJEnc44dB0iDP9zRpUt/UmttO0Tgrkq8x9DUHgSbe3/MVRrHCKFEUhZrnSeVupzAIFCpUNw8ad7X08Er5OGsKPAWhr7GspG7Qpz/71/pXf/IxPbz/QM/cuaOf+8f/SDff825V06jt5VYXr9+Xml43D451cXGu3XajsWWMR/mapGHQ2Dfq2kZ936rvOzVdrVGzwiiUH/mafd4zlOdHkue7sWEMPV8aJ/Vdp75pbQwU+DbGfhDY2PfzZGPMk4JZYmw9n8/vy4tjBVmiII3l+aGYgyAIJZ8rm+02xjSKY65UnufL90J5caCwyLU4XGu5XCr0I62XK9Vto7brVde1m8tpUp7nWq1WYu5ZC5MntX1nn+n+5VafO6+18UPtbKp9FYGvcGxVLDJdbhtJiSYv1KRBM/95EitHnr2F/eHJlzdz32yvv7/nW/xjlm9rmnlhXc8KNWoRzrq9CHRUxAp8X9tNpYPlgQ6KQmnkKZwmJX6ksevlB4O8YFR50cnvZpWnj7Q9PdPu9FzBOCkJA3V1o8gPtF6vbY3cf/BQ+Xpl6+2Z73uvbv7AC1LfS1Ggs7NTtVc7PXrxDc0jAzxrHHpbY6zBeeiUp