Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Michael Mitchell Ovyerus

🏠
Working from home
View GitHub Profile
View Timer.js
class Timer {
constructor(func, time) {
if (typeof func !== 'function') throw new Error('func is not a function');
if (typeof time !== 'number') throw new Error('time is not a number');
this.timerObj = setInterval(func, time);
this.func = func;
this.time = time;
}
View gist:0d8754a2e9a95ffb54dceb9f3b305902
### Keybase proof
I hereby claim:
* I am ovyerus on github.
* I am ovyerus (https://keybase.io/ovyerus) on keybase.
* I have a public key ASB85aXnzaKdL3MlfWXlFbzjgmYMQlHVJ_jDSftvZ_miGQo
To claim this, I am signing this object:
@Ovyerus
Ovyerus / detidebot.js
Created Jan 25, 2017
discord seflbot that does magic
View detidebot.js
const Eris = require('eris');
const bot = new Eris("TOKEN");
const detideReplace = {
'(': ')',
')': '(',
'{': '}',
'}': '{',
'[': ']',
']': '[',
@Ovyerus
Ovyerus / TestFileDirectoryCreator.py
Last active May 1, 2017
Script to generate a directory with a random name and with random files with random extensions and random content.
View TestFileDirectoryCreator.py
import os, string, random, re, argparse, sys, shutil
parser = argparse.ArgumentParser(description='Generate a random directory with randomly generated files within.')
parser.add_argument('-v', '--version', action='version', version='%(prog)s 1.4', help='Display the version of the program.')
parser.add_argument('-a', '--amount', default=random.randrange(50, 200), type=int, help='Set the amount of files to generate.')
parser.add_argument('-r', '--remove', action='store_true', help='Remove all directories that follow the format created by this program.')
args = parser.parse_args()
amt = args.amount;
@Ovyerus
Ovyerus / ISODateRename.py
Last active May 3, 2017
Script to rename all files in current directory
View ISODateRename.py
import os, re, argparse, sys
from datetime import datetime
parser = argparse.ArgumentParser(description='Rename files to have a prefix of their created date.')
parser.add_argument('-v', '--version', action='version', version='%(prog)s v2.0', help='Display the version of the program.')
parser.add_argument('-f', '--file', default=' ', type=str, help='Choose which file to rename.')
parser.add_argument('-d', '--directory', default='./', type=str, help='Choose a directory to rename all files in.')
parser.add_argument('-i', '--ignore', default='@', type=str, help='Choose ignore files starting with a character.')
args = parser.parse_args()
View deobfuscate.js
const ObfusRegex = /^([A-z]+)-(?![^A-Za-z0-9])(?=.*[A-Z])(?=.*[a-z])/;
function deobfuscate() {
var items = document.body.getElementsByTagName('*');
var classes = [];
for (let i of items) if (i.className != '') classes.push(i);
classes = classes.filter(e => !(e.className instanceof SVGAnimatedString));
classes.forEach(e => e.classList.forEach(c => {if (ObfusRegex.test(c) && !e.className.includes(' ' + c.match(ObfusRegex)[0].slice(0, -1))) e.className += ' ' + c.match(ObfusRegex)[0].slice(0, -1)}));
@Ovyerus
Ovyerus / hacknet-script-docs.md
Last active Sep 25, 2017
Documentation for Hacknet's hacker scripts
View hacknet-script-docs.md

Hacknet Scripts

Executing a Hacker Script

Hacknet.HackerScriptExecuter.runScript("HackerScripts/Script.txt", os);
// This implies that you're running this in a Pathfinder command.
// If not, you'll have to replace `os` with an instance of the players os
// somehow.

Default scripts are ThemeHack.txt (Naix's theme deleter) and SystemHack.txt (Striker's VMBootloaderTrap) To use your own script, create one using the documentation below and then add it to the Content/HackerScripts folder in your Hacknet installation path.

@Ovyerus
Ovyerus / Coord Getter.ahk
Last active Oct 12, 2017
mathfactspro numbers to use
View Coord Getter.ahk
CoordMode, Mouse, Screen
=::
MouseGetPos, X, Y
MsgBox % "X Coord: " . X . " Y Coord: " . Y
clipboard = [%X%,%Y%]
Return
@Ovyerus
Ovyerus / Cursor Flipper.ahk
Last active Dec 1, 2018
flip flop that cursor baby
View Cursor Flipper.ahk
; Constants
MOUSE_SWAP := 0x21
SET_CURSORS := 0x57
KEY_ORDER := ["Arrow","Help","AppStarting","Wait","Crosshair","IBeam","NWPen","No","SizeNS","SizeWE","SizeNWSE","SizeNESW","SizeAll","UpArrow","Hand"]
SCHEME = scheme name
; Generate scheme list
RegRead, SchemeList, HKEY_CURRENT_USER\Control Panel\Cursors\Schemes, % SCHEME,
SchemeList := StrSplit(SchemeList, ",")
@Ovyerus
Ovyerus / cool-button.jsx
Created Apr 10, 2019
next-css `:export` issue
View cool-button.jsx
import styled from '@emotion/styled';
import variables from '../assets/styles/css';
export const CoolStyledButton = styled.button`
color: ${variables.primaryText};
background: ${variables.background};
`;
You can’t perform that action at this time.