Skip to content

Instantly share code, notes, and snippets.

@mminer
mminer / cachedecorator.py
Created January 12, 2015 23:57
An example of a Python decorator to simplify caching a function's result.
"""An example of a cache decorator."""
import json
from functools import wraps
from redis import StrictRedis
redis = StrictRedis()
def cached(func):
@ChampionAsh5357
ChampionAsh5357 / 1204-1205-primer.md
Last active April 24, 2024 02:55
Minecraft 1.20.4 -> 1.20.5 Mod Migration Primer

Minecraft 1.20.4 -> 1.20.5 Mod Migration Primer

This is a high level, non-exhaustive overview on how to migrate your mod from to 1.20.4 from 1.20.5. This does not look at any specific mod loader, just the changes to the vanilla classes.

This primer is licensed under the Creative Commons Attribution 4.0 International, so feel free to use it as a reference and leave a link so that other readers can consume the primer.

If there's any incorrect or missing information, please leave a comment below. Thanks!

Pack Changes

@hackerb9
hackerb9 / bwtest.sh
Last active April 24, 2024 02:54
Busybox compatible simple speedtest that downloads a file to /dev/null. Useful for sshing into various routers and seeing where the bottleneck is.
#!/bin/sh
# Silly speed test just by downloading a file directly to /dev/null
# Useful on routers which only have busybox installed.
# ↄ⃝🄯 B9 2016, 2018, 2023. Creative Commons Zero.
# NOTA BENE: cachefly has worked for over a decade, however they may
# be getting tired of scripts like this. Starting February 2023, their
# 100mb.test file is empty and the 50mb.test file holds 100MB.
dotest() {
@Snarp
Snarp / HTML Named Color Keywords.md
Last active April 24, 2024 02:52 — forked from jennyknuth/README.md
140 html color names as an array of json objects—enjoy!

HTML Colors

All 140 HTML colors as JSON objects with fields:

  • name
  • hex
  • rgb
  • families

Changelog

@Snarp
Snarp / google-docs-copy.js
Last active April 24, 2024 02:51
Script to allow copying from a protected Google Doc
/*
<https://stackoverflow.com/questions/40296831/is-it-possible-to-force-a-copy-of-a-protected-google-doc>
NOTE - 2021-05-24
-----------------
The script below isn't the fastest way to copy-and-paste from a protected
Google Doc. Before trying it, I'd suggest following MikoFrosty's advice from
the comments:
@aamiaa
aamiaa / CompleteMokokoQuest.md
Last active April 24, 2024 02:50
Complete Discord Mokoko Quest

Complete Discord Mokoko Quest

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
  2. Join a vc
  3. Stream any window (can be notepad or something)
  4. Press Ctrl+Shift+I to open DevTools
  5. Go to the Console tab
  6. Paste the following code and hit enter:
let wpRequire;
@long-woo
long-woo / npm.taobao.sh
Last active April 24, 2024 02:48 — forked from 52cik/npm.taobao.sh
npm 淘宝镜像配置
npm set registry https://registry.npmmirror.com # 注册模块镜像
npm set disturl https://npmmirror.com/mirrors/node/ # node-gyp 编译依赖的 node 源码镜像
## 以下选择添加
npm set sass_binary_site https://npmmirror.com/mirrors/node-sass/ # node-sass 二进制包镜像
npm set electron_mirror https://npmmirror.com/mirrors/electron/ # electron 二进制包镜像
npm set puppeteer_download_host https://npmmirror.com/mirrors # puppeteer 二进制包镜像
npm set chromedriver_cdnurl https://npmmirror.com/mirrors/chromedriver/ # chromedriver 二进制包镜像
npm set operadriver_cdnurl https://npmmirror.com/mirrors/operadriver/ # operadriver 二进制包镜像
npm set phantomjs_cdnurl https://npmmirror.com/mirrors/phantomjs/ # phantomjs 二进制包镜像
@fatum12
fatum12 / ttc2ttf.pe
Last active April 24, 2024 02:45
Unpack .ttc and .dfont to .ttf using FontForge
#!/usr/local/bin/fontforge
# Usage: fontforge -script ttc2ttf.pe /path/to/font.ttc
fonts = FontsInFile($1)
n = SizeOf(fonts)
i = 0
while (i < n)
Open($1 + "(" + fonts[i] + ")", 1)
index = ToString(i + 1)
@anburocky3
anburocky3 / Vite-Tailwind-Github-Integration.md
Last active April 24, 2024 02:44
Tailwind, Vite integration with Github-Pages deployment steps

TailwindCss-Vite

  1. Create project using the below commands.
npm create vite@latest my-project-name
> Vanilla
> JavaScript
import React, {
createContext,
useState,
useCallback,
useContext,
useEffect,
} from 'react';
import AsyncStorage, {
useAsyncStorage,