Skip to content

Instantly share code, notes, and snippets.

View jnm2's full-sized avatar
🧬
Evolving

Joseph Musser jnm2

🧬
Evolving
View GitHub Profile
@jnm2
jnm2 / Visual Studio.xml
Created April 9, 2020 15:28 — forked from iam3yal/Visual Studio.xml
Notepad++ Visual Studio Theme
<?xml version="1.0" encoding="Windows-1252" ?>
<!--
Theme name : Visual Studio
-->
<NotepadPlus>
<LexerStyles>
<LexerType name="sql" desc="SQL" ext="">
<WordsStyle name="KEYWORD" styleID="5" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" keywordClass="instre1" />
<WordsStyle name="NUMBER" styleID="4" fgColor="0060BF" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
<WordsStyle name="STRING" styleID="6" fgColor="007BEF" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
@jnm2
jnm2 / _ff-addon-snippet-WinAPI_EnumHandles.js
Created March 9, 2020 11:12 — forked from Noitidart/_ff-addon-snippet-WinAPI_EnumHandles.js
_ff-addon-snippet-WinAPI_EnumHandles - Enumerate handles WinAPI. (js-ctypes) (Windows)
Cu.import("resource://gre/modules/ctypes.jsm");
var lib_ntdll = ctypes.open("ntdll.dll");
var lib_kernel32 = ctypes.open("kernel32.dll");
var STATUS_BUFFER_TOO_SMALL = 0xC0000023>>0;
var STATUS_INFO_LENGTH_MISMATCH = 0xC0000004>>0;
var SystemHandleInformation = 16;
var UNICODE_STRING = new ctypes.StructType("UNICODE_STRING", [
{'Length': ctypes.unsigned_short}, //USHORT
@jnm2
jnm2 / _ff-addon-snippet-WinAPI_EnumHandlesExAndReadFilePaths.js
Created March 9, 2020 11:12 — forked from Noitidart/_ff-addon-snippet-WinAPI_EnumHandlesExAndReadFilePaths.js
_ff-addon-snippet-WinAPI_EnumHandlesExAndReadFilePaths - Trying to read file paths of handles returned from a PID that is not equal to the PID of where the code is running from. (js-ctypes) (Windows)
Cu.import('resource://gre/modules/ctypes.jsm');
var lib = {
ntdll: ctypes.open('ntdll.dll'),
kernel32: ctypes.open('kernel32.dll'),
}
//HANDLE WINAPI GetCurrentProcess(void);
var GetCurrentProcess = lib.kernel32.declare("GetCurrentProcess", ctypes.winapi_abi, ctypes.voidptr_t);
//DWORD WINAPI GetCurrentProcessId(void);
@jnm2
jnm2 / _ff-addon-snippet-WinAPI_NtDll.js
Created March 9, 2020 11:12 — forked from Noitidart/_ff-addon-snippet-WinAPI_NtDll.js
_ff-addon-snippet-WinAPI_NtDll - Demonstrating some capabilities of ntdll. [jsctypes] [windows]
Cu.import("resource://gre/modules/ctypes.jsm");
var lib_ntdll = ctypes.open("ntdll.dll");
var lib_kernel32 = ctypes.open("kernel32.dll");
var _pPID = null;
var STATUS_BUFFER_TOO_SMALL = 0xC0000023>>0;
var STATUS_INFO_LENGTH_MISMATCH = 0xC0000004>>0;
var SystemProcessInformation = 5;
var SystemBasicInformation = 0;
var SystemProcessorPerformanceInformation = 8;
@jnm2
jnm2 / boxstarter.ps1
Created June 17, 2019 12:38 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:

1. Separation of immutable and mutable logic

Quite a lot of different people have been on the same trail of thought. Gary Bernhardt's formulation of a "functional core, imperative shell" seems to be the most voiced.

"Boundaries" - Gary Bernhardt

"Imperative shell" that wraps and uses your "functional core".. The result of this is that the shell has fewer paths, but more dependencies. The core contains no dependencies, but encapsulates the different logic paths. So we’re encapsulating dependencies on one side, and business logic on the other side. Or put another way, the way to figure out the separation is by doing as much as you can without mutation, and then encapsulating the mutation separately. Functional core — Many fast unit tests. Imperative shell — Few integration tests

https://www.youtube.com/watch?v=yTkzNHF6rMs

@jnm2
jnm2 / waitForKeyElements.js
Created November 15, 2016 04:10 — forked from BrockA/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);