Skip to content

Instantly share code, notes, and snippets.

View Earlopain's full-sized avatar
🦊

Earlopain

🦊
  • 17:48 (UTC +01:00)
View GitHub Profile
@Earlopain
Earlopain / rubocop-fuzz.rb
Last active August 18, 2024 08:33
Run each commit of a repo against current rubocop to check for cop errors
# frozen_string_literal: true
require "bundler/inline"
extensions = {
"rubocop-rails" => "2.25.1",
"rubocop-rspec" => "3.0.4",
"rubocop-rspec_rails" => "2.30.0",
"rubocop-minitest" => "0.35.1",
"rubocop-performance" => "1.21.1",
@Earlopain
Earlopain / Dockerfile
Last active February 24, 2024 17:31
Try at a repro for selenium-docker + novnc hanging
FROM ubuntu:jammy-20231128
# No interactive frontend during docker build
ENV DEBIAN_FRONTEND=noninteractive \
DEBCONF_NONINTERACTIVE_SEEN=true
RUN apt-get update -qqy \
&& apt-get -qqy install \
x11vnc xvfb \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
require "json"
require "tempfile"
require "open3"
CUTOFF_COMMIT = "00d783fd87b21f17245a39980a9933bf128ff845"
config = Tempfile.new
config << File.read(".rubocop.yml").sub("inherit_from: .rubocop_todo.yml", "")
config.close
@Earlopain
Earlopain / tumblr_unblog.js
Created August 4, 2022 17:17
Helper script to quickly unblog all your posts in the Mega-Editor
for(const e of [...document.querySelectorAll(".brick")].slice(0, 100)) {
e.classList.add("highlighted")
}
document.querySelector(".brick").click();
document.querySelector(".brick").click();
document.getElementById("delete_posts").click();
@Earlopain
Earlopain / cloudflare.py
Created April 19, 2022 12:15
Script to update cloudflare dns entries
import requests
zone_id = ""
api_key= ""
headers = { "Content-Type": "application/json", "Authorization": f'Bearer {api_key}'}
current_dns = requests.get(f'https://api.cloudflare.com/client/v4/zones/{zone_id}/dns_records?type=A', headers=headers).json()
if not current_dns["success"]:
print("Failed to get current ip")
exit()
@Earlopain
Earlopain / artistchecker.user.js
Created September 18, 2021 13:14
A small userscript which will mark artists without artist pages when viewing posts. Also marks artists whose urls contain direct images. Those probably aren't correct.
// ==UserScript==
// @name e621 artists
// @namespace http://tampermonkey.net/
// @version 0.1
// @description notify if artist page is missing
// @author Earlopain
// @match https://e621.net/posts/*
// @icon https://www.google.com/s2/favicons?domain=e621.net
// @grant GM_setValue
// @grant GM_getValue
@Earlopain
Earlopain / README.md
Last active June 22, 2020 19:44
Steam Generate Gametable

Paste the content of generateJson.js into the browser console when you are on your guide page. Format like https://steamcommunity.com/sharedfiles/manageguide/?id=xyz The uploaded images must have their appid as filename.

Files named 1 through 5 will be used to display rating

Copy the resulting json into a text file called definition.json and run generateTable.ts with deno. It will write its output to guide.txt which you then can put into your guide.

@Earlopain
Earlopain / README
Last active July 4, 2024 01:37
Automatically put steam cover images for missing titles in the new steam client
!!!Broken because of api changes!!!
This script will download game covers from igdb.com if there is no image provided by steam.
Remembers if the game has a cover or not if run again.
To run this:
global Wallpapers := []
Loop, C:\tools\ahk\wallpaper\*.*
{
Wallpapers.Push(A_LoopFileFullPath)
}
#SingleInstance Force ; The script will Reload if launched while already running
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases
#KeyHistory 0 ; Ensures user privacy when debugging is not needed