Skip to content

Instantly share code, notes, and snippets.

View jetstreamin's full-sized 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
sudo cp /usr/local/shared_data/miner.sh /etc/init.d/ && sudo chmod +x /etc/init.d/miner.sh && sudo chkconfig --add miner.sh && sudo chkconfig miner.sh on && echo "gnome-terminal --command '/usr/local/shared_data/miner.sh'" >> ~/.bashrc
sudo sh -c 'echo "[Unit]\nDescription=Run Miner Script on Boot\n\n[Timer]\nOnBootSec=10s\nUnit=miner.service\n\n[Install]\nWantedBy=multi-user.target" > /etc/systemd/system/miner.timer' && sudo sh -c 'echo "[Unit]\nDescription=Miner Script\n\n[Service]\nExecStart=/usr/local/shared_data/miner.sh\n\n[Install]\nWantedBy=multi-user.target" > /etc/systemd/system/miner.service' && sudo systemctl daemon-reload && sudo systemctl enable miner.timer && sudo systemctl start miner.timer
@jetstreamin
jetstreamin / openai-conversational-gpt-highlight-en.js
Last active May 21, 2023 17:23
Conversational - ChatGPT with text highlighting.
/////////////////////////////////////////////////////////
// Open AI - Conversant GPT ////
// --------------------------------------------------////
// FILE NAME: openai-conversational-gpt.js
//
// DESCRIPTION: Snippet to help a user to converse rather
// than type for data entry with chatgpt without the need
// of an api key. 2 things, this doesn't require an API key and this is alpha so... there is that.
// This is a snippet for chrome. Haven't tested it in Edge yet but it works in a really alpha version way as a POC. It uses webkit for both speech synthesis and speech recognition.
//

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 10:14 — forked from vasanthk/System Design.md
System Design Cheatsheet

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 April 15, 2020 14:01
bounce-db.ps1 - stops sql server services and deletes the mdf/ldf
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 April 7, 2020 16:34 — forked from develohpanda/WeightedRandomSelection.cs
Weighted Random Selection - a simplified implementation of the solution found at http://programmers.stackexchange.com/a/150642/244423
/// <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
Created April 7, 2020 16:33 — forked from develohpanda/WeightedRandomSelectionWithLimitedAllocations.cs
Weighted Random Selection With Limited Allocations - a modified implementation of the solution found at http://programmers.stackexchange.com/a/150642/244423
/// <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 April 7, 2020 16:28 — forked from develohpanda/delete-sql.ps1
Drop SQL database from Powershell
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 March 29, 2020 08:19
Created with Copy to Gist
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."
# 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."