Skip to content

Instantly share code, notes, and snippets.

View pldubouilh's full-sized avatar

Pierre Dubouilh pldubouilh

View GitHub Profile
@jgrahamc
jgrahamc / pwnd.js
Created February 24, 2018 16:36
Cloudflare Workers that adds an "Cf-Password-Pwnd" header to a POST request indicating whether the 'password' field appears in Troy Hunt's database of pwned passwords.
addEventListener('fetch', event => {
event.respondWith(fetchAndCheckPassword(event.request))
})
async function fetchAndCheckPassword(req) {
if (req.method == "POST") {
try {
const post = await req.formData();
const pwd = post.get('password')
const enc = new TextEncoder("utf-8").encode(pwd)
#!/bin/bash
# author: Pushpal Sidhu <[email protected]>
# date: 20180620
#
# Place this into the file "/lib/systemd/system-sleep/keybase-suspend"
# and mark it executable.
# Copied out of /usr/bin/run_keybase on 20180620. It'd be nice if they
# allowed run_keybase to be sourced then call the kill_all() function
@natanlao
natanlao / syncthing-photo-sync.md
Last active February 23, 2025 18:47
Syncing iPhone photos with Syncthing

For those who prefer to avoid solutions like iCloud Photos and Dropbox for backing up photos, you can sync your iPhone photos with Syncthing. To do this, you'll need two things:

  • Möbius Sync is, to my knowledge, the only actively-maintained Syncthing client for iOS. It's free to sync up to 20 MB, and only $4.99 (one-time) to remove that limit.

  • PhotoSync is a nifty iOS app for syncing photos to a number of different destinations. It's free for low-quality

@lxpk
lxpk / MPSelectMiniV2-PrusaSlicer_config_bundle.ini
Last active December 14, 2024 17:40 — forked from todbot/MPSelectMiniV2-PrusaSlicer_config_bundle.ini
My attempt at a PrusaSlicer config bundle for Monoprice Select Mini V2. Import with "File" -> "Import..." -> "Import Config Bundle"
# generated by PrusaSlicer 2.2.0+ on 2020-04-02 at 04:02:32 UTC
[print:0.175mm - Monoprice Mini Select v2]
avoid_crossing_perimeters = 0
bottom_fill_pattern = rectilinear
bottom_solid_layers = 3
bottom_solid_min_thickness = 0
bridge_acceleration = 0
bridge_angle = 0
bridge_flow_ratio = 1
@Henje
Henje / papers_please_fix.cpp
Last active February 28, 2023 23:10
Simple hack to disable joystick scanning and remove stutters from Papers Please.
#include <string>
#include <dlfcn.h>
#include <stdio.h>
#include <sys/mman.h>
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
using namespace std::literals;
#!/bin/bash
set -e
##### CHECK PARAMETERS #####
PRODUCTION=0
while [[ "$#" -gt 0 ]]; do
case $1 in
-p|--production) PRODUCTION=1 ;;
*) echo "Unknown parameter passed: $1"; exit 1 ;;
esac
shift