Skip to content

Instantly share code, notes, and snippets.

# mount.cifs
mount.cifs //hayley-pc/hayley /mnt/hayley -o credentials=/root/.cifscreds,uid=$(id -u hayley),gid=$(id -g hayley)
# /etc/fstab
echo //hayley-pc/hayley /mnt/hayley cifs credentials=/root/.cifscreds,uid=$(id -u hayley),gid=$(id -g hayley) 0 0
hayley@debian:~$ cat /etc/systemd/system/mnt-hayley.mount
[Unit]
Description=cifs mount script
Requires=network-online.target
After=network-online.service
// ==UserScript==
// @name Twitch - Big emotes
// @version 1
// @grant none
// @match https://www.twitch.tv/*
// @run-at document-start
// ==/UserScript==
//
// ==UserScript==
// @name GitHub "Earliest Commit"
// @version 1
// @grant none
// @match https://github.com/*
// ==/UserScript==
const exec = () => {
const exists = (...sel) => {
return sel.every((s) => document.querySelectorAll(s).length > 0);
@hayleyxyz
hayleyxyz / Debouncer.cs
Last active July 26, 2020 20:41 — forked from pmunin/Debouncer.cs
Action Debouncer for C#
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel;
using System.Timers;
using System.Threading;
using System.Windows.Threading;
/// <summary>
/// Event debouncer helps to prevent calling the same event handler too often (like mark Dirty or Invalidate)
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile\shell\Open with ILSpy]
"Icon"="\"C:\\Users\\hayley\\Projects\\ILSpy\\ILSpy\\bin\\Release\\net6.0-windows\\ILSpy.exe\",0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile\shell\Open with ILSpy\Command]
@="\"C:\\Users\\hayley\\Projects\\ILSpy\\ILSpy\\bin\\Release\\net6.0-windows\\ILSpy.exe\" \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\dllfile\shell\Open with ILSpy]
"Icon"="\"C:\\Users\\hayley\\Projects\\ILSpy\\ILSpy\\bin\\Release\\net6.0-windows\\ILSpy.exe\",0"
const getEventNames = (root) => {
let events = [ ];
const objectHasSubPrototype = (object, comp) => {
let proto = Object.getPrototypeOf(object);
while(proto !== null && proto !== EventTarget) {
proto = Object.getPrototypeOf(proto);
}
// ==UserScript==
// @name Discord - Hide blocked messages
// @version 1
// @grant none
// @match https://discordapp.com/*
// @run-at document-start
// ==/UserScript==
(() => {
const callback = (mutationsList, observer) => {
const x = (strings, ...params) => {
let arr = '';
for(let i = 0; i < params.length; i++) {
arr += (strings[i]);
arr += (params[i]);
}
arr += (strings[params.length]);
/* You have a set of scales which are unbalanced and the aim is to use a maximum of two of the remaining weights to see if you can balance the scales. If you do need to use 2 weights they can be placed on the same scale.
Write a function that can accept 3 arguments. The first argument will be an integer greater than 0 that represents the current weight of the left scale, the second argument will be an integer greater than 0 that represents the weight of the right scale and the last argument will be an array of positive integers that represent the weights you currently have remaining to use.
For example (5, 9, [3,5,8,12]). 5 represents the left scale’s current weight. 9 represents the right scale’s current weight and the array represents the weights you have at your disposal.
If you can balance the scales then the function should return an array of the number(s) required to make the scales balance. Otherwise it can return nil/null.
Examples
input (6, 8, [3, 4, 5, 8])
@hayleyxyz
hayleyxyz / ida64.reg
Last active May 19, 2024 22:24
Add "Open with IDA Pro (64-bit)" menu item
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\dllfile\shell\Open with IDA Pro]
"Icon"="\"C:\\Program Files\\IDA Pro 8.3\\ida64.exe\",0"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\dllfile\shell\Open with IDA Pro\Command]
@="C:\\Program Files\\IDA Pro 8.3\\ida64.exe \"%1\""
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\exefile\shell\Open with IDA Pro]
"Icon"="\"C:\\Program Files\\IDA Pro 8.3\\ida64.exe\",0"