Skip to content

Instantly share code, notes, and snippets.

View RichardSlater's full-sized avatar
🏠
Working from home

Richard Slater RichardSlater

🏠
Working from home
View GitHub Profile
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGBplmMBEAC4/lTwUbkk6KB7sC9AoY5OPu8dgInZig58EPHjviENNVr8do+Q
n0slQp6Fp3C6Mj6gyVtfaWVxb9ZE9aTMPf8Kg/bxSHCYKYYLa/ZAerbYQjWW/esa
fsYIps46jHbj4HDIqtSwE9Qg+g3CcOAifos2v0Kqpu/Lwt9VXxwH1J5GMiGJHjf3
vnfZDBq1yRhxOs4pEvPJgfyw1OUFtFGhh1AMwtd+36SxzC0Jv0LdXzEAkwcmJVMC
UeyZU98pZWjlIDndr9rYiuHF5DASwObD9GDf1hNP5y/bw3PmIUmdh09c+IfsYeyv
YklZ5HCUsN20oqKKxTgD7ZVnlq7ZyMG1HbleqVyk6OrGyCG/X1wjZFe1cCOvNZKS
+qFzzZFnHTPCkOqbC3IskcA7IfALhHCeKjZE7niXjZ8Nm/e7kFmCT1bdd2VZiZ8B
5SGz+4zu9Ohiguu6SF+R65zc3hmGdWggQE3y/ySlEvpPZ9rJ9yB5E0eZ7J/grpoF
@RichardSlater
RichardSlater / WharfKitTransactions.ts
Created November 7, 2023 19:02
Using WharfKit in React /w Typescript
"use client"
import styles from './page.module.css'
import { useCallback, useEffect } from 'react';
import React from 'react'
import WalletButton from './components/WalletButton';
import { SessionKit, Session } from "@wharfkit/session"
import { WebRenderer } from "@wharfkit/web-renderer"
@RichardSlater
RichardSlater / aws-datacenter-ip-ranges.xml
Created January 31, 2014 10:46
All AWS IP address ranges
<!-- AWS Region: US East (Northern Virginia) -->
<add ipAddress="72.44.32.0" subnetMask="255.255.224.0" allowed="true" />
<add ipAddress="67.202.0.0" subnetMask="255.255.192.0" allowed="true" />
<add ipAddress="75.101.128.0" subnetMask="255.255.128.0" allowed="true" />
<add ipAddress="174.129.0.0" subnetMask="255.255.0.0" allowed="true" />
<add ipAddress="204.236.192.0" subnetMask="255.255.192.0" allowed="true" />
<add ipAddress="184.73.0.0" subnetMask="255.255.0.0" allowed="true" />
<add ipAddress="184.72.128.0" subnetMask="255.255.128.0" allowed="true" />
<add ipAddress="184.72.64.0" subnetMask="255.255.192.0" allowed="true" />
<add ipAddress="50.16.0.0" subnetMask="255.254.0.0" allowed="true" />

Linking my account richardslater on GitHub with my address 0x0860f22da6ba75627ddad10ad198ffb215a8fe76 on EVM in mycryptoprofile.io, and the challenge code is: dda32788572262c2df8133ca19e79e9a. #LitentryVerifyMyAddress

@RichardSlater
RichardSlater / connect-to-gdrive.py
Created March 26, 2022 20:08
Medium.com: Creating AI Art? Has your Super-SloMo model stopped working?
from google.colab import drive
drive.mount('/content/drive')
@RichardSlater
RichardSlater / format.ps1
Created March 4, 2022 13:01
Format CSV as IP Address List for qBittorrent (p2p)
Function Format-IP ($ip) {
$octets = $ip.Split(".") | Select-Object @{label="Octet";expression={ [Int32]::Parse($_).ToString("000") }}
return [String]::Join(".", $octets.Octet)
}
$ips = Import-Csv .\ru.csv | Select-Object -Property Start, End, Notes
$output = $ips | Select-Object @{label="Start";expression={ Format-IP $_.Start }}, @{label="End";expression={ Format-IP $_.End }}, notes
$output | ForEach-Object { "{0} - {1} , 000 , {2}" -f $_.Start, $_.End, $_.Notes }
@RichardSlater
RichardSlater / day1.cs
Last active December 3, 2021 16:00
Advent of Code 2021
var depths = File.ReadAllLines(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "input.txt")).Select(x => Int32.Parse(x));
// part 1
depths
.Skip(1)
.Zip(depths, (curr, prev) => curr > prev)
.Count(x => x == true)
.Dump("Part 1: Depths larger than previous depth");
// part 2
@RichardSlater
RichardSlater / step1.ps1
Last active October 12, 2020 19:49
Install SSH Client on Windows 10
Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'
@RichardSlater
RichardSlater / Initialize-SharedAssemblyInfo.ps1
Last active February 10, 2019 09:31
Initialize-SharedAssemblyInfo
function Initialize-SharedAssemblyInfo {
Param(
[Parameter(Mandatory=$False)]
[Switch]$RemoveComments = $False
)
process {
$crlf = [System.Environment]::NewLine;
$current = $PSScriptRoot;
while ((-Not (Test-Path "$current\Solutions")) -Or ($current.Length -lt 4)) {
@RichardSlater
RichardSlater / MongoDB.ps1
Created January 16, 2014 17:37
Desired State Configuration to Install MongoDB on Windows Server 2013
configuration MongoDB {
param (
[string[]]$ComputerName = $env:ComputerName
)
node $ComputerName {
File SetupFolder {
Type = 'Directory'
DestinationPath = "C:\setup"
Ensure = 'Present'
}