Skip to content

Instantly share code, notes, and snippets.

@lukem512
lukem512 / compactBits.js
Created December 20, 2017 23:19
Bitcoin difficulty target to compact bits conversion
var MAX_PRECISION = 28;
function _findExp (n, base, exp = 1) {
var pow = Math.pow(base, exp);
var div = Math.floor(n / pow);
if (exp > MAX_PRECISION) {
return div;
}
return div + _findExp(n, base, exp + 1);
}
@xuesongbj
xuesongbj / inet_ntop and inet_pton example
Created May 15, 2019 09:03
inet_ntop and inet_pton example
// IPv6 demo of inet_ntop() and inet_pton()
// (basically the same except with a bunch of 6s thrown around)
struct sockaddr_in6 sa;
char str[INET6_ADDRSTRLEN];
// store this IP address in sa:
inet_pton(AF_INET6, "2001:db8:8714:3a90::12", &(sa.sin6_addr));
// now get it back and print it
@mluisbrown
mluisbrown / Rx2Ras-Cheatsheet.md
Last active May 17, 2024 17:33
An RxSwift to ReactiveSwift cheatsheet
@abduhbm
abduhbm / at_to_df.py
Created April 10, 2019 14:57
Retrieve a table from Airtable to Pandas DataFrame
import requests
import pandas as pd
BASE_URL = 'https://api.airtable.com/v0/'
def airtable_to_dataframe(base_name, table_name, api_key):
header = {'Authorization': 'Bearer ' + api_key}
data = []
r = requests.get(BASE_URL + base_name + '/' + table_name, headers=header)
@TheSunCat
TheSunCat / DisblockOrigin.theme.css
Last active May 17, 2024 17:31
Hide all Nitro & Boost upsells in Discord!
/**
* @name Adblock for Discord
* @author TheSunCat and contributors
* @version 1.0.0
* @description Hide all Nitro & Boost upsells on Discord!
* @source https://gist.github.com/TheSunCat/58fedaa19d6154ef3e4b2b676c286906
*/
/* ------------------ */
/* Hide Nitro upsells */
@dompurified
dompurified / DubyasCleanupOfDiscord.css
Created April 2, 2024 17:00 — forked from DubyaDude/DubyasCleanupOfDiscord.css
My list of annoying stuff I hide/disable in Discord using Quick CSS
/* Dubyas list of annoying stuff he hides in discord using Quick CSS */
/* Disable emoji inspection upsell (ty Regalia) */
[class^="nitroTextAndBadge_"], button:has([class^="premiumIcon_"]),
[class^="emojiSection_"] [class^="flex_"] div[class*="text-sm-normal"]
{
display:none;
}
/* Disable Popup ads */
@m5r
m5r / index.tsx
Created February 26, 2022 20:22
bullmq job queue in Remix
import notifierQueue from "~/queues/notifier.server.ts";
export const loader = async () => {
await notifierQueue.add("test", { emailAddress: "mokhtar@remixtape.dev" });
return null;
};
@pwnall
pwnall / chrome_android_buid.md
Last active May 17, 2024 17:26
Step-by-step instructions for setting up a VM that builds Chrome for Android

Build Instructions for libchromewebview.so

This document contains step-by-step instructions for building a Chromium-powered Android WebView.

Chromium's build process is a bit fussy, and the Android target is even more fussy, so the least painful way of getting it done is to set up a VM with the exact software that the build process was designed for. The steps below accomplish this.

@flaksp
flaksp / README.md
Last active May 17, 2024 17:26
Convert BitWarden JSON export file to Apple iCloud Keychain CSV import file saving TOTP and notes

BitWarden to Apple iCloud Keychain passwords converter

This Python scripts allows you to move your passwords from BitWarden to Apple iCloud.

You need to know:

  • It ignores secure notes, credit cards and other types that are not passwords.
  • It ignores BitWarden entries without usernames, passwords and URLs.
  • It also ignores URLs that do not start with http:// or https://.
  • It normalizes all TOTP tokens, e.g. wskg vtqa h5kl bhb4 v4v2 ybyo woc6 qme2 will be converted to otpauth://totp/example.com:dude@foo.bar?secret=WSKGVTQAH5KLBHB4V4V2YBYOWOC6QME2&issuer=example.com&algorithm=SHA1&digits=6&period=30.
@origamiofficial
origamiofficial / Recaptcha Solver (Automatically solves Recaptcha in browser).user.js
Created March 25, 2022 04:42
Recaptcha Solver in Browser | Automatically solves Recaptcha in browser by engageub | Note: This script is solely intended for the use of educational purposes only and not to abuse any website. This script uses audio in order to solve the captcha. Use it wisely and do not abuse any website. Click "Raw" to install it on Tampermonkey
// ==UserScript==
// @name Recaptcha Solver (Automatically solves Recaptcha in browser)
// @namespace Recaptcha Solver
// @version 2.1
// @description Recaptcha Solver in Browser | Automatically solves Recaptcha in browser
// @author engageub
// @match *://*/recaptcha/*
// @connect engageub.pythonanywhere.com
// @connect engageub1.pythonanywhere.com
// @grant GM_xmlhttpRequest