Skip to content

Instantly share code, notes, and snippets.

@antlionguard
antlionguard / twitter-remove-retweets.js
Last active May 1, 2024 23:22
With this script, you can remove all retweets you are retweeted on Twitter.
const timer = ms => new Promise(res => setTimeout(res, ms));
// Unretweet normally
const unretweetTweet = async (tweet) => {
await tweet.querySelector('div[data-testid="unretweet"]').click();
await timer(250);
await document.querySelector('div[data-testid="unretweetConfirm"]').click();
console.log('****// Unretweeted Successfully //****')
}
@enomoto
enomoto / LocaleExtension.swift
Last active May 1, 2024 23:22
Change locale in XCTestCase
private extension MyTests {
private func setLocaleAsJP() {
let original = class_getClassMethod(NSLocale.self, #selector(getter: NSLocale.current))!
let swizzled = class_getClassMethod(NSLocale.self, #selector(NSLocale.myCurrentLocale))!
method_exchangeImplementations(original, swizzled)
}
}
// https://stackoverflow.com/questions/31065859/how-can-i-change-the-locale-on-the-xcode-playground
fileprivate extension NSLocale {
@FusRoDah061
FusRoDah061 / dump-uwp-apps.md
Created April 3, 2021 01:24
Dump UWP apps files

Overview

Most apps and games downloaded from Microsoft Store on Windows 10 are placed on a special folder (WindowsApps), which the user probably won't have access.

That said, in case you want to use mods in a game, you'll likely need access to the it's files. Even though Microsoft introduced the option to enable mods, not all developers have adopted this yet (if some ever will). This document presents an alternative to get access to the files you may need.

This is basically a copy-paste of u/WiredRawdy's reddit post.

Requirements

@ahbanavi
ahbanavi / encryption.php
Last active May 1, 2024 23:18
Encrypt / Decrypt JSON data between Python and PHP using AES 256 GCM
<?php
const PASSPHRASE = ''; // use 'openssl rand -hex 32' to generate key, same with python
function encrypt(array $data): string
{
$data_json_64 = base64_encode(json_encode($data));
$secret_key = hex2bin(PASSPHRASE);
$iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('aes-256-gcm'));
$tag = '';
$encrypted_64 = openssl_encrypt($data_json_64, 'aes-256-gcm', $secret_key, 0, $iv, $tag);
@0xdevalias
0xdevalias / reverse-engineering-webpack-apps.md
Last active May 1, 2024 23:17
Some notes and techniques for reverse engineering Webpack (and a little bit about React/Vue) apps
@thomasfr
thomasfr / Git push deployment in 7 easy steps.md
Last active May 1, 2024 23:17
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@megahirt
megahirt / Docker with XDebug.md
Last active May 1, 2024 23:16
Debugging PHP with XDebug v3 inside Docker using VSCode

Debugging PHP with XDebug v3 inside Docker using VSCode

Assumptions / Prerequisites

  • XDebug v3+ inside Docker (e.g. php:7.3-apache Docker image)
  • Running Docker v20.10+
  • VSCode with PHP Debug Extension (Felix Becker)
  • Using Docker Compose for orchestration

Objective

@WerySkok
WerySkok / MediaWiki.conf
Created October 8, 2023 20:26
NGINX config for MediaWiki
server {
listen 80;
server_name example.wiki;
# this config assumes that MediaWiki is installed into /opt/mediawiki/w,
# so LocalSettings.php would be located at /opt/mediawiki/w/LocalSettings.php
root /opt/mediawiki;
index index.php;
# allow larger file uploads and longer script runtimes
@leocomelli
leocomelli / git.md
Last active May 1, 2024 23:16
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

KFZUS-F3JGV-T95Y7-BXGAS-5NHHP
T3ZWQ-P2738-3FJWS-YE7HT-6NA3K
KFZUS-F3JGV-T95Y7-BXGAS-5NHHP
65Z2L-P36BY-YWJYC-TMJZL-YDZ2S
SFZHH-2Y246-Z483L-EU92B-LNYUA
GSZVS-5W4WA-T9F2E-L3XUX-68473
FTZ8A-R3CP8-AVHYW-KKRMQ-SYDLS
Q3ZWN-QWLZG-32G22-SCJXZ-9B5S4
DAZPH-G39D3-R4QY7-9PVAY-VQ6BU
KLZ5G-X37YY-65ZYN-EUSV7-WPPBS