Skip to content

Instantly share code, notes, and snippets.

View sclark39's full-sized avatar

Skyler Clark sclark39

View GitHub Profile
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
using { /UnrealEngine.com/Temporary/Diagnostics }
item_roller_device := class(creative_device):
@editable RollTime:float = 5.0
@editable PickupTimeout:float = 5.0
@editable RollCycleDelay:float = 0.1
let prev_tab_id = {}
async function onClick(tab)
{
try {
let current_tab = tab.id;
let current_window = tab.windowId;
// Find all the gmail tabs
var tabs = await browser.tabs.query({ windowId: current_window, url: "*://mail.google.com/*" });
if ( tabs.length == 0 )
@sclark39
sclark39 / RemixNamedTensors.py
Last active September 28, 2021 19:09
Function to take in a tensor and a desired set of named dimensions and then squeeze, unsqueeze and permute to match
def NTremix( tensor, target_dims, align='left', squeeze=True ):
# remove extra dimensions
if ( squeeze ):
tensor = tensor.squeeze()
# add missing dimensions
dim0 = tensor.names[0]
target_set = set(target_dims)
missing = [(dim0,tensor.size(dim0))]
@sclark39
sclark39 / RenameGenericGraph.js
Last active May 11, 2021 14:08
Quickly rename all assets and files in GenericGraph plugin and ready it for inclusion in another plugin
'use strict';
const mkdirp = require('mkdirp');
const path = require('path');
const fs = require('fs');
const readline = require('readline').createInterface({
input: process.stdin,
output: process.stdout
});
@sclark39
sclark39 / RemoveRiftSPhantomControllers.js
Created August 6, 2019 13:55
Run to fix phantom controllers showing up in Oculus after low battery events
const fs = require( 'fs' )
console.log( `Make sure OVRService has been stopped and Oculus is closed before running this!` )
let filename = process.env.LOCALAPPDATA + '\\Oculus\\DeviceCache.json';
console.log( `Opening ${filename}.` )
let file = fs.readFileSync( filename, {encoding: 'utf8'} )
let json = JSON.parse(file)
@sclark39
sclark39 / NMSRefinerRecipes.json
Last active August 21, 2022 16:57
Json data with all the valid refiner recipes n No Man's Sky, along with the materials involved
{
"mats": {
"FUEL1": {
"Name": "Carbon",
"Symbol": "C",
"Icon": "TEXTURES/UI/FRONTEND/ICONS/U4SUBSTANCES/SUBSTANCE.FUEL.1.DDS",
"Color": "BA3730"
},
"FUEL2": {
"Name": "Condensed Carbon",
function Foo( Name )
return function( Table )
; Construct
return something
end
end
;Called with:
Foo 'Bar' {}
@sclark39
sclark39 / 123Fortnite.ahk
Last active June 23, 2018 15:45
123 lines to becoming a Fortnite god - Custom lastinv bind, hold to toggle crouch, and confirm build on mouse up
HotKey, IfWinActive, Fortnite
; Fortnite Binds
Fortnite.RegisterKey( "1", "MeleeSlotKey" )
Fortnite.RegisterKey( "2", "WeaponSlotKey" )
Fortnite.RegisterKey( "3", "WeaponSlotKey" )
Fortnite.RegisterKey( "4", "WeaponSlotKey" )
Fortnite.RegisterKey( "z", "WeaponSlotKey" )
Fortnite.RegisterKey( "x", "WeaponSlotKey" )
Fortnite.RegisterKey( "q", "BuildKey" )
@sclark39
sclark39 / day3.js
Last active December 7, 2017 09:57
Advent of code 2017 Day 3 part 2
// Advent of Code 2017 - Day 3 Part 2
// by @sclark39
var add = ( a, b ) => ([ a[0] + b[0], a[1] + b[1] ])
var turn = (a) => ( a[0] == 0 ? [ -a[1], 0 ] : [ 0, a[0] ] )
function buildSpiral(input)
{
var spiral = [ [1] ]
spiral.get = ( c ) => ( spiral[c[0]] && spiral[c[0]][c[1]] )
@sclark39
sclark39 / day4.js
Last active December 4, 2017 23:04
Solution to the Advent of Code 2017 Day 4
// var passphrases = input.split('\n')
function countValid( passphrases, allowAnagrams )
{
return passphrases.reduce( (s,passphrase) => {
var passwords = passphrase.split(' ')
passwords = allowAnagrams ? passwords : passwords.map( a => ( a.split('').sort().join('') ) )
return s + passwords.reduce( ( s,n,i,a ) => s && a.indexOf(n) == i )
}, 0 )
}