Skip to content

Instantly share code, notes, and snippets.

View M3TIOR's full-sized avatar
😵‍💫
Trying to finish something

Ruby Allison Rose M3TIOR

😵‍💫
Trying to finish something
  • Vancouver WA, USA
View GitHub Profile
@M3TIOR
M3TIOR / dichromate.py
Last active November 25, 2019 12:19
A utility to expose chrome apps on the command line. (could just use aliases but this is automated & easier)
#!/usr/bin/env python3
#
# Copyright (c) 2019 Ruby Allison Rose
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@M3TIOR
M3TIOR / rm-rf.js
Created October 21, 2019 01:33
A NodeJS function that emulates `rm -rf <dir>`
const path = require('path');
const fs = require('fs');
/***
* Warning! there is no error handling for this :/
* It's also indescriminant of open files.
*/
function rmdashrf(dirname){
let remaining = fs.readdirSync(dirname, { withFileTypes: true })
.map(dirent => dirent.name = path.join(dataStore, dirent.name));
@M3TIOR
M3TIOR / fliplock.py
Last active October 9, 2019 19:09
Locks the screen using slock on acpi lid close event. Handy for use with i3-wm
#!/usr/bin/env python3
# Copyright (c) 2019 Ruby Allison Rose (aka M3TIOR)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
@M3TIOR
M3TIOR / package.json
Last active September 29, 2019 05:54
toriellint
{
"name": "toriel",
"version": "1.0.0",
"description": "A passive bridge between the two monoliths, ESLint and TypeScript. Creating superior linting and typechecking for all the realms.",
"main": "toriellint.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"bin": {
"toriel": "./toriellint.js"
@M3TIOR
M3TIOR / modcat.sh
Last active August 15, 2019 03:30
Get modinfo for all running kernel modules.
#!/bin/bash
#
# Copyright (c) 2019 Ruby Allison Rose (aka: M3TIOR)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@M3TIOR
M3TIOR / calico.js
Created August 5, 2019 04:40
A CLI for the Fort Vancouver Regional Library group's events calendar.
#!/usr/bin/env node
/***
* Copyright (c) 2019 Ruby Allison Rose (aka: M3TIOR)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@M3TIOR
M3TIOR / nodesquared.js
Created August 4, 2019 09:58
List and update installed and linked NPM packages from the CLI
#!/usr/bin/env node
/***
* Copyright (c) 2019 Ruby Allison Rose (aka: M3TIOR)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@M3TIOR
M3TIOR / migrate-python-packages.sh
Last active May 13, 2019 14:43
Attempt to migrate all pip packages from one python version to another. Skips externally installed packages etc. as not to ruin system stability.
#!/bin/bash
# This is incomplete and I'm tired. For the most part Everything needed Is here. Bah humbug.
# I just had to clean anaconda from my computer and it was a nightmare. Bleh.
migrate(){
# Loop through our source Python Version's installed packages.
while read pack; do
# Attempt installing the current package using the target Python Version.
python3.7 -m pip install $pack;
@M3TIOR
M3TIOR / compareJupyterNotebookOutputImages.js
Last active May 8, 2019 22:24
Dysfunctional Jupyter Javascript Injected Blob Comparator
// Grumble Grumble Grumble... this doesn't work because security reasons...
// I spent six hours on this... God dammit (-_-")...
/***
* Javascript scraper for comparing raster outputs of the two gradient types.
* This script ensures both our gradients are the same down to the tiniest
* details from the end user perspective.
*/
// bootstrap from python. Must be formated from python string.
var width = %d;
var height = %d;
@M3TIOR
M3TIOR / personal-notebook
Created May 1, 2019 00:22
A script that's supposed to open a Jupiter notebook instance in the directory the script is located in.
#!/bin/bash
# ------------------------------------------------------------------------------
# Copyright (c) 2019 Ruby Allison Rose
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions: