Skip to content

Instantly share code, notes, and snippets.

View shunia's full-sized avatar
💭
hV7?eR6#hC5-qT6+

shunia shunia

💭
hV7?eR6#hC5-qT6+
  • GEHC
  • Beijing,China
View GitHub Profile
@olets
olets / A Tailwind CSS aspect-ratio Replacement Supporting Safari 14.md
Last active October 11, 2023 19:25
A Tailwind CSS aspect-ratio Replacement Supporting Safari 14
@alyleite
alyleite / wsl.md
Last active July 10, 2024 19:19
Failed to connect to bus: Host is down - WSL 2

» sudo systemctl daemon-reload

System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down

==============================================

Edit*

  1. Open /etc/wsl.conf with any editor:
@phlinhng
phlinhng / a-clash-tproxy-gateway.md
Last active June 2, 2024 09:55
Clash as transparent proxy gateway via TPROXY

Notes

  1. If your local network use public IP ranges instead of private ones, make sure to add respecive RETURN rules to iptables to prevent looping issue
  2. Set clash as DHCP's only DNS server to allow domain-based filter (shunting) rules work
  3. Use lsof -i udp:53 to check if clash's DNS module work fine, otherwise you may have to kill systemd-resolved and any other processes occupying the UDP 53 port
  4. The given scripts will NOT hangle the traffic of gateway itself since it is not recommend to do so. If you want to redirect the egress traffic of the gateway, the following material may be useful

Reference

@mattyellen
mattyellen / UnityAsyncOperationAwaiter.cs
Created July 26, 2020 19:36
Allows the use of async/await (instead of yield) with any Unity AsyncOperation
public static class ExtensionMethods
{
public static TaskAwaiter GetAwaiter(this AsyncOperation asyncOp)
{
var tcs = new TaskCompletionSource<object>();
asyncOp.completed += obj => { tcs.SetResult(null); };
return ((Task)tcs.Task).GetAwaiter();
}
}
@499978920
499978920 / profile.ps1
Created June 30, 2020 06:04
[powershell proxy] power shell 走代理 #powershell #proxy
# path
# C:\Program Files\PowerShell\7
function set_proxy_variable {
$proxy = 'http://127.0.0.1:10809'
# temporary
$env:HTTP_PROXY = $proxy
$env:HTTPS_PROXY = $proxy
@nukadelic
nukadelic / EditorFontSize.cs
Last active July 18, 2024 21:41
Unity Editor Font Size Changer -- EditorStyles
#if UNITY_EDITOR
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Reflection;
public class EditorFontSize : EditorWindow
{
// enable resize on launch to set a default font size , using this option will disable the ability to have the window accassible
@maboloshi
maboloshi / README.md
Last active July 21, 2024 01:30
[Mac下配置Aria2] #macOS #aria2

Mac下配置Aria2

安装和设置 Aria2

# 使用 Homebrew 安装 aria2
brew install aria2

# 创建配置文件aria2.conf和空对话文件aria2.session
mkdir ~/.aria2 && cd ~/.aria2
touch aria2.conf
@yuzebin
yuzebin / open163_dl.sh
Last active June 15, 2018 08:10
网易公开课下载脚本 open.163.com
#!/usr/bin/env bash
# author: yuzebin AT gmail
# 20180614
# open163_dl.sh
main() {
mkdir -p $2
cd $2
curl $1 | grep -e "http://open.163.com/movie/" | enca -L zh -x UTF-8 | sed -e "s/\<a href=\"//g" -e "s/\>//g" -e "s/<\/a//g" | grep -v class | sed -e "s/\ //g"> $2.lst
@tommyettinger
tommyettinger / mulberry32.c
Last active June 8, 2024 09:35
Mulberry32 PRNG
/* Written in 2017 by Tommy Ettinger (tommy.ettinger@gmail.com)
To the extent possible under law, the author has dedicated all copyright
and related and neighboring rights to this software to the public domain
worldwide. This software is distributed without any warranty.
See <http://creativecommons.org/publicdomain/zero/1.0/>. */
#include <stdint.h>
@swillits
swillits / Keycodes.swift
Last active July 19, 2024 05:51
Swift Keyboard Keycodes
struct Keycode {
// Layout-independent Keys
// eg.These key codes are always the same key on all layouts.
static let returnKey : UInt16 = 0x24
static let enter : UInt16 = 0x4C
static let tab : UInt16 = 0x30
static let space : UInt16 = 0x31
static let delete : UInt16 = 0x33
static let escape : UInt16 = 0x35