Skip to content

Instantly share code, notes, and snippets.

500 Error: Log File / Stack Trace Animation

This weeks code-doodle is just a little 500 error page mockup. Tried to capture the feeling of going through stack traces and lines and lines of log-files in an aesthetically pleasing way. -- wanted to mess around with css variables so likely doesn't work too well in ie :)

A Pen by Adam Quinlan on CodePen.

License.

@sunfkny
sunfkny / convert-cookies.js
Created February 23, 2022 08:15
Cookie File for youtube-dl & you-get
(function() {
let S = '# Netscape HTTP Cookie File\n';
for (raw_cookie of document.cookie.split(';')) {
let cookie = raw_cookie.trim();
let separator = cookie.indexOf('=');
let name = cookie.substring(0, separator);
let value = cookie.substring(separator + 1);
let domain = window.location.hostname;
// hopefully this will convert domains like `www.test.com` and `test.com` into `.test.com`
@sunfkny
sunfkny / install-vscode-server.sh
Last active January 31, 2023 03:23
install vscode server with a single command
commit_id=$(python -c "print(__import__('requests').get('https://update.code.visualstudio.com/api/update/linux-x64/stable/VERSION').json()['version'])") && mkdir -p ~/.vscode-server/bin/${commit_id} && cd ~/.vscode-server/bin/${commit_id} && wget https://vscode.cdn.azure.cn/stable/${commit_id}/vscode-server-linux-x64.tar.gz -O vscode-server-linux-x64.tar.gz && tar zxvf vscode-server-linux-x64.tar.gz --strip 1
@sunfkny
sunfkny / watch_log.py
Created March 6, 2023 01:33
watch_log.py
#!/usr/bin/python3
import os
from pick import pick
title = "Please choose the log to watch:"
options = [
# logs path here
]
file, index = pick(options, title)
@sunfkny
sunfkny / admin.py
Last active November 15, 2023 02:19 — forked from hakib/admin.py
Django Admin InputFilter
# common/admin.py
class InputFilter(admin.SimpleListFilter):
template = 'admin/input_filter.html'
def lookups(self, request, model_admin):
# Dummy, required to show the filter.
return ((),)
def choices(self, changelist):
#!/bin/bash
set -e
PYTHON_VERSION="3.10.12"
PYTHON_MINOR_VERSION="$(echo $PYTHON_VERSION | cut -d'.' -f 2)"
PYTHON_BUILD_VERSION="$(echo $PYTHON_VERSION | cut -d'.' -f 3)"
yum -y install epel-release
yum -y install gcc zlib zlib-devel libffi libffi-devel readline-devel mysql-devel sqlite-devel
yum -y install wget
yum install -y wget tar gzip gcc make expect
# 下载源码
wget --no-check-certificate https://www.sqlite.org/src/tarball/sqlite.tar.gz
# 编译
tar xzf sqlite.tar.gz
cd sqlite
export CFLAGS="-DSQLITE_ENABLE_FTS3 \
from typing import Iterable, List, Literal
from typing_extensions import TypedDict
from eth_typing import HexStr
from eth_utils.crypto import keccak
from eth_utils.hexadecimal import encode_hex, remove_0x_prefix
def keccak_hex(hexstr: str):
return encode_hex(keccak(hexstr=hexstr))
const oldAddEventListener = document.body.addEventListener;
const events = ["mouseenter", "mouseleave"]
unsafeWindow.bodyListeners = {}
document.body.addEventListener = function (event, listener, options) {
if (events.includes(event)) {
if(unsafeWindow.bodyListeners[event]){
console.warn("[修复重复卡片请求]", event, unsafeWindow.bodyListeners)
document.body.removeEventListener(event, unsafeWindow.bodyListeners[event], options)
}