Skip to content

Instantly share code, notes, and snippets.

View PhilipRoman's full-sized avatar

Philip Roman PhilipRoman

  • Latvia
View GitHub Profile
@auchenberg
auchenberg / index.js
Created March 31, 2024 23:25
Script to delete all Google Photos from console (2024)
const maxCount = 500;
const counterSelector = '.rtExYb';
const checkboxSelector = '.ckGgle[aria-checked=false]';
const photoDivSelector = ".yDSiEe.uGCjIb.zcLWac.eejsDc.TWmIyd";
const deleteButtonSelector = 'button[aria-label="Delete"]';
const confirmationButtonSelector = '#yDmH0d > div.VfPpkd-Sx9Kwc.cC1eCc.UDxLd.PzCPDd.V639qd.bvQPzd.oEOLpc.A9Uzve.VfPpkd-Sx9Kwc-OWXEXe-FNFY6c > div.VfPpkd-wzTsW.O4g5Md.iWO5td > div > div.VfPpkd-cnG4Wd.m5OsGf > div > div.VfPpkd-T0kwCb.IdSMxc > button.VfPpkd-LgbsSe.VfPpkd-LgbsSe-OWXEXe-k8QpJ.nCP5yc.AjY5Oe.LQeN7.kDryjd';
async function deleteGooglePhotos() {
// Retrieves the current count of selected photos
const getCount = () => {
@Oderjunkie
Oderjunkie / CPP.ORG
Last active January 1, 2025 16:31
C Preprocessor Abuse

C Preprocessor Abuse

@GestaltEngine
GestaltEngine / box.c
Created November 12, 2021 02:38
Changes rendering of fractions
/* equation boxes */
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "eqn.h"
struct box *box_alloc(int szreg, int pre, int style)
{
struct box *box = malloc(sizeof(*box));
@Gavinok
Gavinok / y.tmac
Last active May 24, 2024 18:24
A collection of groff,pic,and eqn macros used in many of my local files. Note that many of these are not my own work and come from a variety of sources.
.defcolor LOCALBLUE rgb 0.1 0.1 0.9
.de NOTE
\m[LOCALBLUE]NOTE\m[]: \\$*
..
.de PROOF
.ft BI
PROOF
.ft
..
.defcolor LOCALRED rgb 1 0.0 0.0
@pojntfx
pojntfx / main.sh
Last active December 9, 2024 13:18
PXE booting iPXE in a QEMU virtual machine with the host's DHCP and TFTP server
sudo ip tuntap add tap0 mode tap user root
sudo ip addr add dev tap0 10.0.0/24
sudo ip link set tap0 up
# See https://pojntfx.github.io/go-isc-dhcp/
cat >/tmp/dhcpd.yaml <<EOF
dhcpd:
device: tap0
subnets:
- netmask: 255.255.255.0
@Konamiman
Konamiman / 0. WiFi for Ethernet-only devices via Raspberry Pi.md
Last active January 10, 2025 01:31
How to use a Raspberry Pi to provide WiFi for Ethernet-only devices, and how to use stunnel as a SOCKS server ro provide indirect TLS support

What's this?

I love MSX computers. I have developed quite a few things for them, including a TCP/IP stack and some networking applications. Some other MSX nerds have developed networking hardware, so boom! Here it is, Internet access from MSX, a 1980s 8 bit machine. How cool is that?

However there are a few issues that prevent us the MSX users to reach the absolute networking happiness:

  1. At the time of this writing, there isn't any solution for wireless Internet for MSX, only Ethernet hardware.
  2. InterNestor Lite, the TCP/IP stack for MSX, doesn't support TLS. It's not that the developer (me!) is too lazy to implement it, it's just that a Z80 can't handle the required encryption algorythms. Trust me, I tried.

So

@kay
kay / hsdis-ubuntu.sh
Last active October 21, 2019 21:16 — forked from zajacmp3/hsdis-ubuntu.sh
Build hsdis for JDK 1.8 on Debian/Ubuntu
sudo apt-get install libgmp-dev libmpfr-dev libmpc-dev g++-multilib mercurial texinfo
hg clone http://hg.openjdk.java.net/jdk8u/jdk8u
cd jdk8u
hg update jdk8u92-b14
sed -ri 's/subrepos="[^"]+"/subrepos="hotspot"/' ./make/scripts/hgforest.sh # only get hotspot
sed -ri 's/subrepos="[^"]+"/subrepos="hotspot"/' ./common/bin/hgforest.sh # only get hotspot
chmod +x ./get_source.sh; ./get_source.sh
cd hotspot/src/share/tools/hsdis
wget http://ftp.heanet.ie/mirrors/ftp.gnu.org/gnu/binutils/binutils-2.29.tar.gz
tar -xzf binutils-2.29.tar.gz
@justinian
justinian / linux-x64-nasm-cheatsheet.md
Last active January 17, 2025 04:17
x64 NASM Cheat Sheet

x64 NASM cheat sheet

Registers

64 bit 32 bit 16 bit 8 bit
A (accumulator) RAX EAX AX AL
B (base, addressing) RBX EBX BX BL
C (counter, iterations) RCX ECX CX CL
D (data) RDX EDX DX DL
@byjg
byjg / NoVNC_Paste.js
Last active November 19, 2024 21:20
How to Paste code to NoVNC.
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for long passwords
(function () {
window.sendString = function (str) {
f(str.split(""));
function f(t) {
var character = t.shift();
var i=[];
var code = character.charCodeAt();
var needs_shift = character.match(/[A-Z!@#$%^&*()_+{}:\"<>?~|]/);
@romainl
romainl / colorscheme-override.md
Last active November 9, 2024 21:05
The right way to override any highlighting if you don't want to edit the colorscheme file directly

The right way to override any highlighting if you don't want to edit the colorscheme file directly

Generalities first

Suppose you have weird taste and you absolutely want:

  • your visual selection to always have a green background and black foreground,
  • your active statusline to always have a white background and red foreground,
  • your very own deep blue background.