Skip to content

Instantly share code, notes, and snippets.

View solrevdev's full-sized avatar
💭
🤓

John Smith solrevdev

💭
🤓
View GitHub Profile
@solrevdev
solrevdev / Default (OSX).sublime-keymap
Last active April 4, 2022 10:31
Sublime text keymap to map shift+home and shift+end to highlight current line
[
{ "keys": ["ctrl+super+g"], "command": "find_all_under" },
{ "keys": ["super+f2"], "command": "find_all_under" },
{ "keys": ["super+alt+l"], "command": "split_selection_into_lines" },
{ "keys": ["super+b"], "command": "toggle_side_bar" },
{ "keys": ["super+shift+b"], "command": "build" },
{ "keys": ["alt+up"], "command": "swap_line_up" },
{ "keys": ["alt+down"], "command": "swap_line_down" },
{ "keys": ["shift+home"], "command": "move_to", "args": { "to": "bol", "extend": true } },
{ "keys": ["shift+end"], "command": "move_to", "args": { "to": "eol", "extend": true } },
@solrevdev
solrevdev / yyyymmdd.bat
Created March 28, 2022 13:03
Run a powershell file saving its output to format YYYY-MM-DD_HHMM.txt AKA 2022-03-28_1359.txt
:: Run a powershell file saving its output to format YYYY-MM-DD_HHMM.txt AKA 2022-03-28_1359.txt
::
powershell -f report.ps1 > %date:~6,4%-%date:~3,2%-%date:~0,2%_%time:~0,2%%time:~3,2%.txt
@solrevdev
solrevdev / SeedData.cs
Created January 26, 2022 17:09
Seed data using minimal api
if (args.Length == 1 && args[0].ToLower() == "seeddata")
{
SeedData(app);
}
void SeedData(IHost app)
{
var scopedFactory = app.Services.GetService<IServiceScopeFactory>();
@solrevdev
solrevdev / update-via-macupdater.sh
Last active January 15, 2022 14:26
Uses the macupdater_client (https://www.corecode.io/macupdater/enterprise.html) and jq to update macOS app from the command line
#!/usr/bin/env bash
pc=$(hostname)
echo "macupdater 2 pro command line via $pc on $(date +"%Y-%m-%d %T")"
echo '--------------------------------------------------------------'
echo ''
echo ''
echo 'checking for prerequisites...'
echo '[] jq'
@solrevdev
solrevdev / .NET6Migration.md
Created November 19, 2021 11:45 — forked from davidfowl/.NET6Migration.md
.NET 6 ASP.NET Core Migration
@solrevdev
solrevdev / Preferences.sublime-settings
Last active July 21, 2023 08:53
Sublime Text 3 settings
// Settings in here override those in "Default/Preferences.sublime-settings",
// and are overridden in turn by syntax-specific settings.
{
"font_face" : "IntelOne Mono",
"font_size" : 16,
"font_options" : ["ss01"],
"font_family" : "'IntelOne Mono','CaskaydiaCove Nerd Font','JetBrains Mono',Monaco, 'Anonymous Pro','Liberation Mono', SFMono-Regular, Consolas, 'Dank Mono','Fira Code','Source Code Pro', Menlo, Monaco, 'Courier New', monospace",
"dark_theme": "Adaptive.sublime-theme",
"light_theme": "Adaptive.sublime-theme",
"theme": "Default.sublime-theme",
@solrevdev
solrevdev / CurrentMethodName.cs
Created June 24, 2021 11:05
Get Class and MethodName for current method in C# for example Program.Main.TestMethod
using System;
using System.Reflection;
namespace web
{
public class Startup
{
public static void Main(string[] args)
{
if (args?.Length > 0)

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@solrevdev
solrevdev / .vscodestyles.css
Created November 18, 2020 15:13
.vscodestyles.css
.monaco-shell {
font-family: "Monaco,'Anonymous Pro','Liberation Mono', SFMono-Regular, Consolas, 'Dank Mono','Fira Code','Source Code Pro', Menlo, Monaco, 'Courier New', monospace";
}
/* This makes the dirty tab circle yellow */
.vs-dark .monaco-workbench>.part.editor>.content .editor-group-container>.title .tabs-container>.tab.dirty .close-editor-action {
background: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' height='16' width='16'%3E%3Ccircle fill='%23ffc600' cx='8' cy='8' r='4'/%3E%3C/svg%3E") 50% no-repeat;
}
.monaco-workbench>.part.editor>.content .editor-group-container {
@solrevdev
solrevdev / random-domain-name.js
Created October 9, 2020 10:09
gets a random domain name from https://www.domainsfortherestofus.com/ via cors-anywhere
(async function () {
const response = await fetch('https://cors-anywhere.herokuapp.com/https://www.domainsfortherestofus.com/');
const text = await response.text();
const parser = new DOMParser();
const document = parser.parseFromString(text, 'text/html');
const domain = document.querySelector("body > div.content > div > div > div.left-side > div.domain > a").text;
console.log('domain', domain);
})();