Skip to content

Instantly share code, notes, and snippets.

View wtfaremyinitials's full-sized avatar

Will Franzen wtfaremyinitials

View GitHub Profile
@wtfaremyinitials
wtfaremyinitials / ByteOutputStream.java
Created March 15, 2016 16:26
Easily write one bit at a time in Java
import java.io.*;
public class ByteOutputStream extends FileOutputStream {
byte buffer;
byte pos;
public ByteOutputStream(File file) throws FileNotFoundException {
super(file);
buffer = 0x00;
@wtfaremyinitials
wtfaremyinitials / type.css
Created May 2, 2016 23:23
Basic Responsive Typography
/* https://twitter.com/Dmitry_Zubkov/status/726555594635808768 */
:root {
font-size calc(1vw + 1vh + .5vmin);
}
body {
font 1em/1.6rem sans-serif;
}
@wtfaremyinitials
wtfaremyinitials / addition.js
Created May 20, 2016 00:09
Addition with neural networks
var brain = require('brain.js')
var net = new brain.NeuralNetwork();
console.log('Generating training data...');
var data = [];
for(var i=0; i<100000; i++) {
var obj = {};
obj.input = [];
obj.input[0] = Math.random();
obj.input[1] = Math.random();
@wtfaremyinitials
wtfaremyinitials / autorun.sh
Created June 8, 2016 04:34
Transcend WiFi SD Card telnet
telnetd -l /bin/sh &
@wtfaremyinitials
wtfaremyinitials / keybase.md
Created July 11, 2016 20:47
Keybase Verification

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@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