Skip to content

Instantly share code, notes, and snippets.

@Bluefissure
Bluefissure / fix.py
Last active February 9, 2024 05:44
Fix broken palworld save caused by existing guild & too many capture logs
# author: Bluefissure
# License: MIT License
# Description: Fixes Palworld brokwn save files corrupted by someone existing the guild
# Based on the work of https://github.com/cheahjs/palworld-save-tools/releases/tag/v0.13.0
import argparse
import codecs
import os
import json
from lib.gvas import GvasFile
@nevikw39
nevikw39 / ptt_ip.md
Last active October 21, 2022 08:34
ptt IP

ptt IP

Detect whether an IP address on ptt belong to VPN or proxy networks

一款 userscript, 令您只要雙擊選取 pttIP 便可即時取得相關資訊.

適用於 www.ptt.cc, term.ptt.cc.

安裝步驟

@probonopd
probonopd / Wayland.md
Last active May 21, 2024 08:47
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

Wayland proponents make it seem like Wayland is "the successor" of Xorg, when in fact it is not. It is merely an incompatible alternative, and not even one that has (nor wants to have) feature parity (missing features). And unlike X11 (the X Window System), Wayland protocol designers actively avoid the concept of "windows" (making up incompr

@ld100
ld100 / ArchLinuxWSL2.md
Last active May 13, 2024 11:50
Steps for setting up Arch Linux on WSL2

Migrating from Ubuntu on WSL to ArchLinux on WSL2

Obsolete notice

This document was created back in 2020 and might not be actual nowadays. It is not supported anymore, so use thise information at your own risk.

Upgrading to WSL 2

  • Download WSL2 Kernel
  • run wsl --set-default-version 2 in windows command line, so that all future WSL machine will use WSL2.
@AnatomicJC
AnatomicJC / android-backup-apk-and-datas.md
Last active May 21, 2024 13:45
Backup android app, data included, no root needed, with adb

Backup android app, data included, no root needed, with adb

Note: This gist may be outdated, thanks to all contributors in comments.

adb is the Android CLI tool with which you can interact with your android device, from your PC

You must enable developer mode (tap 7 times on the build version in parameters) and install adb on your PC.

Don't hesitate to read comments, there is useful tips, thanks guys for this !

@miguelmota
miguelmota / util.php
Last active January 7, 2024 16:07
PHP byte array to hex, hex to byte array, string to hex, hex to string utility functions
<?php
function string2ByteArray($string) {
return unpack('C*', $string);
}
function byteArray2String($byteArray) {
$chars = array_map("chr", $byteArray);
return join($chars);
}
@imolorhe
imolorhe / pdf2img.html
Created August 13, 2018 09:38 — forked from jdeng/pdf2img.html
pdf to image using pdf.js
<html>
<body>
<script type="text/javascript" src="//mozilla.github.io/pdf.js/build/pdf.js"></script>
<script type="text/javascript">
var url = "https://docs.google.com/document/export?format=pdf&id=1ML11ZyyMpnAr6clIAwWrXD53pQgNR-DppMYwt9XvE6s&token=AC4w5Vg7fSWH1Hq0SgNckx4YCvnGPaScyw%3A1423618416864";
var pages = [], heights = [], width = 0, height = 0, currentPage = 1;
var scale = 1.5;
function draw() {
@fkztw
fkztw / ptt_autologin.sh
Created January 9, 2018 13:53
A shell script to login PTT via ssh automatically.
#!/usr/bin/env expect
# Login into PTT via SSH.
# Combine crontab with this script so you don't forget to login PTT everyday.
# Usage: /bin/bash -c ${FILE_PATH_OF_THIS_SCRIPT}
# Example in crontab:
# ptt auto login, every day at 12:00 PM
# 0 12 * * * /bin/bash -c ${ABSOLUTE_FILE_PATH_OF_THIS_SCRIPT}
@sebastiencs
sebastiencs / volume.sh
Last active February 13, 2024 11:19
Script to get volume notification with dunst http://imgur.com/a/qWgAw
#!/bin/bash
# You can call this script like this:
# $./volume.sh up
# $./volume.sh down
# $./volume.sh mute
function get_volume {
amixer get Master | grep '%' | head -n 1 | cut -d '[' -f 2 | cut -d '%' -f 1
}
@simonhamp
simonhamp / AppServiceProvider.php
Last active May 16, 2024 09:04
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()