Skip to content

Instantly share code, notes, and snippets.

View wtfaremyinitials's full-sized avatar

Will Franzen wtfaremyinitials

View GitHub Profile
@wtfaremyinitials
wtfaremyinitials / darkmode.js
Created July 17, 2016 15:56
Hack dark mode into websites
function handleProp(node, prop) {
var color = window.getComputedStyle(node)[prop];
if(color == "rgba(0, 0, 0, 0)")
return;
color = color.match(/rgba?\((\d+), (\d+), (\d+)/).splice(1,3);
if(color[0] == color[1] && color[1] == color[2]) {
node.style[prop] = "rgb(" + (256-color[0]) + ", " + (256-color[1]) + ", " + (256-color[2]) + ")";
}
}
@wtfaremyinitials
wtfaremyinitials / id_rsa.pub
Created July 25, 2016 00:50
SSH Auth public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCXn1819eun6KxXJLDH8gg8mFdvljMieOKLluK6J9jw7egqJo54FN4EEIuc1pMukQe3xEV8wPy09/HW3gmzFNUzviO75hU/zqpBkVQo0YCIvAZbs397UUSUcBVOfAdCRoqhkj5fnZ2ZOkQMbiWf+tK4Xj3ueenxyhaQ+DwTZeaxLCjHH+bDvRHVDxVIITZ4T6R9SBArUOjb+FDucyU2o/B+BrMdH8HxymNF4HHc8Vv61o7kxxUPx2pXiJGYI+bIPsdmpi7Amcx80bcfO2z+aRu4e4cFsbL1fEmQYoTVAtGwgsJWKbUqvAFry5qujuKA9ovMgDhMVQp+Ft+/ImuOx7PP
@wtfaremyinitials
wtfaremyinitials / fixdrive.gs
Created July 27, 2016 03:22
Google Drive fix
// School created an archive folder of last years stuff, but finding that
// folder required searching for it. This made the archive accessible.
// This can also be used to put a single file in multiple folders
function fixDrive() {
var root = DriveApp.getRootFolder()
var archive = DriveApp.getFolderById("[snip]")
root.addFolder(archive)
}
@wtfaremyinitials
wtfaremyinitials / blog-fix-googledrive.md
Last active August 8, 2016 18:27
Fix Orphaned Google Drive Folders

Recently my school cleared my Google Drive for the coming school year and moved the old folders to an archive folder. Unfortunately this archive folder doesn't show up in Google Drive's main list of files because it's an orphan. Currently it can only be accessed via search.

The following script will manually add a parent to any Google Drive folder, even orphaned ones. How to use it:

  • Navigate to the folder you would like to add a parent to. Copy the ID of the folder in the URL. (28 random letters and numbers)
@wtfaremyinitials
wtfaremyinitials / osx-console-login.sh
Last active August 16, 2016 18:47
Enable the ">console" username on OSX/macOS
sudo defaults write /Library/Preferences/com.apple.loginwindow.plist "DisableConsoleAccess" NO
_.
_/=\:<
.#/*let}
//as\@#:~/
try()|:-./
*~let:>@{#
<\>}#@~*/
(+!:~/+/
/={+|
_.:+*as=._ _.]@~let[._
#include <iostream>
#include <iomanip>
using namespace std;
/*
0: 50
1: 54
3: 57
6: 59
62: 61
#[cfg(test)]
mod tests {
fn counter() -> Box<FnMut() -> i32 + 'static> {
let mut b = 0;
let ret = move || { b += 1; b };
Box::new(ret)
}
#[test]
@wtfaremyinitials
wtfaremyinitials / gist:c3ff43792d0457373195
Created June 1, 2015 21:44
RSS Feed from SoundCloud
curl -v 'http://api.soundcloud.com/resolve.json?url=http://soundcloud.com/thewanshow/&client_id=[CLIENT_ID]'
http://feeds.soundcloud.com/users/soundcloud:users:[USER_ID]/sounds.rss
@wtfaremyinitials
wtfaremyinitials / blog-49 writeup.md
Last active March 9, 2017 18:54
EasyCTF Writeup - 49 Shades

The challenge states that the image includes shades of gray, #000000 to #F5F5F5. Since all of the pixels are gray, all three bytes of each color will be identical, so only one needs to be considered.

#000000-#F5F5F5 leaves shades 0-245 possible, significantly more than the 50 shades the challenge includes. Dividing these possible shades up evenly, it can be reasonably assumed that each shade is 5 apart.

Next, I wrote a simple Javascript program which would find each possible shade in the image. The shade that is not found is clearly the missing one.