Skip to content

Instantly share code, notes, and snippets.

View rickhenderson's full-sized avatar

Rick Henderson rickhenderson

View GitHub Profile
@rickhenderson
rickhenderson / jscriptsc.js
Created January 23, 2024 21:04 — forked from n4n4R3/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
@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 / 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 / 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

   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 / common-battery-info.md
Last active May 6, 2016 16:10
A collection of battery info for building simple electronic circuits using breadboards or small printed circuit boards. Depending on your level of experience.

Common Battery Info

Battery Type Voltage (V) Capacity (mAh) Chemistry
CR2032 3.0 NA Li-MnO2
AA, AAA 1.5 varies 350 - 1000 Alkaline
AA, AAA 1.2 NiMH or NiCd

Use with LEDs

Header 1

Header 2

Header 3 ### (Hashes on right are optional)

Header 4

Header 5

Markdown plus h2 with a custom ID ## {#id-goes-here}

Link back to H2

This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one

@rickhenderson
rickhenderson / astar.py
Last active April 15, 2021 19:47 — forked from jamiees2/astar.py
A* Algorithm implementation in Python3.
"""
A* Algorithm implementation in Python.
Written by: James Sigurðarson (jamiees2)
Source: https://gist.github.com/jamiees2/5531924
Modified by Rick Henderson
May 5, 2016: Began updating to Python 3.x. Also improved spacing and comments.
Converted xrange() to range(). Converted raw_input() to input().
"""
@rickhenderson
rickhenderson / coded-FrozenLake-v0.py
Last active May 5, 2016 03:29
Problem with frozen and random.
# Basic Agent Class from Code samples on OpenGym
# Modified by Rick Henderson
# Modified on May 4, 2016
# May the 4th be with you!
import logging
import os
import gym
@rickhenderson
rickhenderson / cem-agent-cartpole-v0.md
Created May 5, 2016 03:03
An OpenGym experiment running the CEM sample on Cartpole-v0.

Run examples/cem.py which uses the Cartpole-v0.