Skip to content

Instantly share code, notes, and snippets.

View rickhenderson's full-sized avatar

Rick Henderson rickhenderson

View GitHub Profile
   def mirror(s):
      """
      """
    stack = Stack()
    x = 0
    n = len(s)

    # Check that the index x is valid index before using it. Short circuit evaluation. 
 while x < n and s[x] != 'm':
@rickhenderson
rickhenderson / electronics.md
Last active May 20, 2016 02:18
Working with Electronics

Working With Electronics

Random notes of important things to know when working with electronics. Or mainly a reference guide for me.

LEDS

  • standard size is 5mm
  • many people recommend the 3/16" drill bit for drilling holes
  • I used the 13/64" (5.1594mm) for a "large"? LED and it required some pushing.
  • Useful conversion chart appears here: https://mdmetric.com/tech/cvtchtfdm.htm

Wiring

@rickhenderson
rickhenderson / psCompress.ps1
Created March 23, 2022 17:35 — forked from jesusninoc/psCompress.ps1
Powershell: Compress and decompress byte array
# Compress and decompress byte array
function Get-CompressedByteArray {
[CmdletBinding()]
Param (
[Parameter(Mandatory,ValueFromPipeline,ValueFromPipelineByPropertyName)]
[byte[]] $byteArray = $(Throw("-byteArray is required"))
)
Process {
@rickhenderson
rickhenderson / APIs
Created April 21, 2022 16:32 — forked from JohnLaTwC/APIs
Short List of APIs seen in VBA
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Private Declare PtrSafe Function GetCurrentProcessId Lib "kernel32" () As Long
Public Declare Function Keio2 Lib "kernel32" Alias "LoadLibraryW" (ByVal lpLibFileName As String) As Long
Public Declare Function VEEAAM2 Lib "kernel32" Alias "LoadLibraryW" (ByVal lpLibFileName As String) As Long
Public Declare Function wspPush2 Lib "kernel32" Alias "LoadLibraryW" (ByVal lpLibFileName As String) As Long
Declare Function GetLogicalDrives& Lib "kernel32" ()
Declare Function GetShortPathName Lib "Kernel32.dll" Alias _
Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" ( _
Declare Function GlobalAlloc Lib "kernel32" (ByVal wFlags As Long, ByVal dwBytes As Long) As Long
Declare Function GlobalLock Lib "kernel32" (ByVal hMem As Long) As Long
@rickhenderson
rickhenderson / jscriptsc.js
Created January 23, 2024 21:04 — forked from nek0y4nsu/jscriptsc.js
Janky Old JScript.NET Shellcode Runner
import System;
import System.Runtime.InteropServices;
import System.Reflection;
import System.Reflection.Emit;
import System.Runtime;
import System.Text;
//C:\Windows\Microsoft.NET\Framework\v2.0.50727\jsc.exe Shellcode.js
//C:\Windows\Microsoft.NET\Framework\v4.0.30319\jsc.exe Shellcode.js