Skip to content

Instantly share code, notes, and snippets.

@paulirish
paulirish / how-to-view-source-of-chrome-extension.md
Last active December 5, 2024 01:18
How to view-source of a Chrome extension

Option 1: Command-line download extension as zip and extract

extension_id=jifpbeccnghkjeaalbbjmodiffmgedin   # change this ID
curl -L -o "$extension_id.zip" "https://clients2.google.com/service/update2/crx?response=redirect&os=mac&arch=x86-64&nacl_arch=x86-64&prod=chromecrx&prodchannel=stable&prodversion=44.0.2403.130&x=id%3D$extension_id%26uc" 
unzip -d "$extension_id-source" "$extension_id.zip"

Thx to crxviewer for the magic download URL.

@TRtomasz
TRtomasz / stremio-server.json
Created December 12, 2018 10:06
Stremio fast settings
{
"serverVersion": "4.3.4",
"appPath": "Path to the stremio-server",
"cacheRoot": "Path to the cache-folder",
"cacheSize": 2147483648,
"btMaxConnections": 200,
"btHandshakeTimeout": 20000,
"btRequestTimeout": 4000,
"btDownloadSpeedSoftLimit": 4194304,
"btDownloadSpeedHardLimit": 39321600,
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active December 5, 2024 01:17
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@matthewzring
matthewzring / markdown-text-101.md
Last active December 5, 2024 01:15
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@J-Moravec
J-Moravec / serve.r
Created December 4, 2024 23:07
Implementation of a local server for static website using the R's internal httpd server.
error404 = paste0(
"<!DOCTYPE html>",
"<html lang=\"en\">",
"<head>",
" <meta charset=\"UTF-8\">",
" <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
" <title>Resources not found</title>",
"</head>",
"<body>",
" <div class=\"main\">",
@vanodevium
vanodevium / Caddyfile
Created December 8, 2023 11:20
Caddy server: enable CORS for any domain
(cors) {
@cors_preflight method OPTIONS
header {
Access-Control-Allow-Origin "{header.origin}"
Vary Origin
Access-Control-Expose-Headers "Authorization"
Access-Control-Allow-Credentials "true"
}
@wojteklu
wojteklu / clean_code.md
Last active December 5, 2024 01:12
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@eric1234
eric1234 / README.md
Last active December 5, 2024 01:08
A better way of doing layouts in PHP

Usage

Creating a Layout File

Create a file called layout.php. Where you want the content to appear add <?php echo $content ?>. Here is an example:

@jmceleney
jmceleney / xiaomi-enable-mesh-telnet.py
Last active December 5, 2024 01:05
Python3 file that enables netmode4 on a Xiaomi RB01 AX3200 router
import ssl
import socket
# This script simply replays one side of an intercepted conversation between two Xiaomi
# RB01 (International) AX3200 routers negotiating meshing.
# In effect the script poses as a mesh slave, which causes the mesh master to enable netmode4.
# Enabling netmode is needed as one step in unlocking the router and flashing OpenWrt.
# The router should already have been taken through basic set-up before running this script.
# Netmode4 can be confirmed with curl by requesting the following URL, where ${token} is the "stok"
# variable from your admin session:
#!/usr/bin/env python3
# Author: John McEleney
# The main purpose of this script is to enable netmode4 on Xiaomi RB01 routers.
# To do this the script poses as a mesh slave, which causes the mesh master to enable netmode4.
# It does this by blindly sending HEX strings captured from an actual mesh negotiation between
# two RB01 routers.
# Enabling netmode is needed as one step in unlocking the router and flashing OpenWrt.
# The router should already have been taken through basic set-up before running this script.
#