Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

pedoc pedoc

Block or report user

Report or block pedoc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View semantic-commit-messages.md

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@pedoc
pedoc / BoyerMoore.cs
Created Oct 24, 2018 — forked from mjs3339/BoyerMoore.cs
C# High Performance Boyer Moore Byte Array Search Algorithm
View BoyerMoore.cs
public class BoyerMoore
{
private int[] _jumpTable;
private byte[] _pattern;
private int _patternLength;
public BoyerMoore()
{
}
public BoyerMoore(byte[] pattern)
{
@pedoc
pedoc / simulate keyboard input
Created Sep 20, 2018
simulate keyboard input
View simulate keyboard input
public class Keyboard
{
public void Send(ScanCodeShort a)
{
INPUT[] Inputs = new INPUT[1];
INPUT Input = new INPUT();
Input.type = 1; // 1 = Keyboard Input
Input.U.ki.wScan = a;
Input.U.ki.dwFlags = KEYEVENTF.SCANCODE;
Inputs[0] = Input;
@pedoc
pedoc / ExtensionMethods.cs
Created Jul 2, 2018
byte[] -> hex string(with reversal)
View ExtensionMethods.cs
public static class ExtensionMethods {
public static string ToHex(this byte[] data) {
return ToHex(data, "");
}
public static string ToHex(this byte[] data, string prefix) {
char[] lookup = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
int i = 0, p = prefix.Length, l = data.Length;
char[] c = new char[l * 2 + p];
byte d;
for(; i < p; ++i) c[i] = prefix[i];
You can’t perform that action at this time.