Skip to content

Instantly share code, notes, and snippets.

@Luckz
Luckz / tabsoutlinerdupes.js
Created September 20, 2021 11:11
Tabs Outliner: kill duplicate windows
// ctrl - shift - J on Tabs Outliner to open dev tools,
// then Sources -> Snippets -> New Snippet.
// Rightclick -> Run to execute.
// cyrb53 stolen from https://stackoverflow.com/a/52171480
const cyrb53 = function(str, seed = 0) {
let h1 = 0xdeadbeef ^ seed, h2 = 0x41c6ce57 ^ seed;
for (let i = 0, ch; i < str.length; i++) {
ch = str.charCodeAt(i);
h1 = Math.imul(h1 ^ ch, 2654435761);
@mr-nfamous
mr-nfamous / classbuilder.py
Created September 17, 2018 00:14
Python __build_class__
import dis
from sys import _getframe as GF
def vprint(f, *args, **kws):
kws = ', '.join(f'{k}={v!r}' for k,v in kws.items())
args= ', '.join(a for b in (map(repr, args), (kws,)) for a in b if a)
print(f'{f}({args})')
@yano3
yano3 / gist:1378948
Created November 19, 2011 15:17
git commit --amend --reset-author
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
@jinjier
jinjier / 250.csv
Last active May 5, 2024 04:31
JavDB Top 250 movies code list. [Updated at 2024/02]
1 LAFBD-41
2 SSNI-497
3 ABP-984
4 IPX-580
5 IPX-811
6 IPX-177
7 STARS-804
8 SMBD-115
9 ABP-968
10 ABF-017
# This xorg configuration file will start a dummy X11 server.
# move it to /etc/X11/xorg.conf
# don't forget apt install xserver-xorg-video-dummy;
# based on https://xpra.org/Xdummy.html
Section "ServerFlags"
Option "DontVTSwitch" "true"
Option "AllowMouseOpenFail" "true"
Option "PciForceNone" "true"
Option "AutoEnableDevices" "false"
# apt-get install
sudo apt-get update
# For ubuntu 14.04
sudo apt-get install -y xserver-xorg-video-dummy-lts-trusty
# For ubuntu 16.04
sudo apt-get install -y xserver-xorg-video-dummy-lts-willy
# Copy the xorg.conf to `/etc/X11/xorg.conf`.
wget -P /etc/X11 https://gist.githubusercontent.com/mangoliou/ba126832f2fb8f86cc5b956355346038/raw/b6ad063711226fdd6413189ad905943750d64fd8/xorg.conf
// Poll example Discord.js V14.15.1
import { PollData } from 'discord.js';
const poll: PollData = {
question: {
text: 'PHP is good?',
},
answers: [
{
@asukakenji
asukakenji / go-stdlib-interface-selected.md
Last active May 5, 2024 04:26
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

Remove osxfuse if installed via homebrew:
> brew uninstall osxfuse
Install osxfuse binary and choose to install the MacFUSE compatibility layer:
http://sourceforge.net/projects/osxfuse/files/latest/download?source=files
Reboot (optional but recommended by osxfuse)
Install ntfs-3g via homebrew:
> brew update && brew install ntfs-3g
@ChenYFan
ChenYFan / TGTalk-worker.js
Last active May 5, 2024 04:24
Worker获取Telegram公开频道的信息,算是一个变相的说说系统
addEventListener('fetch', event => {
event.respondWith(TelgramChannelStarter(event.request))
})
const ChannelName = 'Cyanwoof'
const version = "2.1.7"
let denined = true
const deninedRegion = ["CN"]
const TelgramChannelStarter = async (request) => {
const url = new URL(request.url)