Skip to content

Instantly share code, notes, and snippets.

View sneakers-the-rat's full-sized avatar

Jonny Saunders sneakers-the-rat

View GitHub Profile
@sneakers-the-rat
sneakers-the-rat / e_hashs.json
Last active June 10, 2024 08:32
Elsevier PDF "hashes"
[
"FCi27mtaKod38ztmGndn-y8NNz.r.lt6SndqGztz_ztr-ngqQm9aMo9eOnMeJntuNntu",
"D2ei2mgqJz9b-m.mGmPqRyLNNnwmOlt7.ywiGmt-Kndr9otqRywv8o9ePmtiNmd2Sn92Tma",
"6U7vcmPuOn9uLnMaGyM7-nLNNntv9lt6RmtaGmweOyMmJnMmSmgmOo9eOnM6LnMaRmM-Tma",
"lXLf8owyQztiMzwqGnMz7zcNNotb7lwf.m9qGzt6Km.qMngqLndqLo9eOotaNm96Mmt6Tma",
"FCi27y9qOnd-Ny96GmPmOmcNNzwf-lwj-m9mGztz7ytaMnM78n9v-o9ePmM6Rm9-Qn9eTma",
"XlEDumMz7nM7-m9iGogmRmLNNyt_8lwiKz9eGm9-Pm.v7ztiLztz_o9eOnMeQnd-Sodm",
"lXLf8yt-JywmNmPeGm9n9n8NNzgn.lt_8zwqGogz7zgn7zt6SyPr-o9eOnM6Pot2Mn9qTma",
"FCi27zgf8mdqMmMeGnMmMy8NNz9eQlweNy.eGmMiMm96Qmgr9nMb-o9ePmtuRmt6JotmTma",
"FCi27nwmKnMeSodeGm.z.y8NNntz.lt-PywmGy9__ngqQmtiPmtb7o9ePmteJotyJoduTma",
@sneakers-the-rat
sneakers-the-rat / clean_pdf.sh
Last active February 10, 2025 18:41
Strip PDF Metadata
# --------------------------------------------------------------------
# Recursively find pdfs from the directory given as the first argument,
# otherwise search the current directory.
# Use exiftool and qpdf (both must be installed and locatable on $PATH)
# to strip all top-level metadata from PDFs.
#
# Note - This only removes file-level metadata, not any metadata
# in embedded images, etc.
#
# Code is provided as-is, I take no responsibility for its use,
@sneakers-the-rat
sneakers-the-rat / gate_input.js
Last active January 5, 2022 09:12
gate mouse events
// define key that toggles class
const ctrlKeys = ['CapsLock', 'ControlRight'];
// make element to block pointer events
let blockStyle = document.createElement('style')
blockStyle.type = "text/css"
blockStyle.innerText = "* {pointer-events: none !important;}"
// register callback to detect keydown events to gate
document.addEventListener('keydown', (e) => {
@sneakers-the-rat
sneakers-the-rat / hypothesis_sidebar.js
Created October 14, 2021 06:23
change color of hypothes.is bucket sidebar
window.onload = function() {
let style = document.createElement('style');
style.textContent = `
.Buckets__list {
background-color: transparent !important;
}
`
let container = document.getElementsByTagName("hypothesis-sidebar")[0];
container.shadowRoot.appendChild(style);
@sneakers-the-rat
sneakers-the-rat / _profile_jekyll.rb
Created October 5, 2021 20:59
Profile Jekyll Build with ruby-prof
require "jekyll"
require "ruby-prof"
result = RubyProf.profile do
# you can set any of the --options you'd pass to build here
# it will automatically pick up the _config.yml file in source
options = {
"source" => './',
"destination" => './_site',
protocol = [
{
"allow_repeat": False,
"graduation": {
"type": "n_trials",
"value": {
"current_trial": "0",
"n_trials": "200",
"type": "n_trials"
}
@sneakers-the-rat
sneakers-the-rat / grid_search_ssm.ipynb
Created March 12, 2021 00:01
grid_search_ssm.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sneakers-the-rat
sneakers-the-rat / remove_meta.sh
Last active July 16, 2024 10:34
remove pdf metadata
####
# 1) install exiftool and qpdf
# https://exiftool.org/
# http://qpdf.sourceforge.net/
# (can be installed with homebrew: brew install exiftool qpdf )
####
# 2) remove metadata - this step is reversible, so we will need to recreate the PDF afterwards
exiftool -all:all= /location/of/some/file.pdf
@sneakers-the-rat
sneakers-the-rat / yt-dl.sh
Created January 6, 2021 23:24
using youtube dl
###########
# Mac
# (copy and paste these into your Terminal (Open Terminal from Applications > Utilities > Terminal)
# 1. install homebrew if you haven't already
# https://brew.sh/
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 2. install youtube-dl
brew install youtube-dl
@sneakers-the-rat
sneakers-the-rat / gist:0d17da7c9297ca1d33b23fa33086c3a4
Created January 2, 2021 05:14
use acme to issue and maintain a cert on cpanel
# curl https://get.acme.sh | sh
./.acme.sh/acme.sh --force --issue -d website.com -d www.website.com -w /home/nod3bp3usey4/public_html/website_path
./.acme.sh/acme.sh --deploy -d website.com -d www.website.com --deploy-hook cpanel_uapi