Skip to content

Instantly share code, notes, and snippets.

View roy2220's full-sized avatar
🎯
Focusing

Roy O'Young roy2220

🎯
Focusing
  • Guangzhou, China
View GitHub Profile
@roy2220
roy2220 / karabiner-elements-rule.json
Last active October 2, 2025 16:19
karabiner-elements-rule.json
{
"description": "All-in-one",
"manipulators": [
{
"conditions": [
{
"name": "caps_lock_alone",
"type": "variable_if",
"value": 1
}
@roy2220
roy2220 / a.js
Created May 28, 2022 02:48
js to remove the title and borders from a grip page
document.querySelector("#readme").parentElement.style = "position:absolute;top:0px;left:0px;";
document.querySelector("#readme").style = style="border-style:none;"
document.querySelector("#readme").children[1].style = style="border-style:none;"
document.querySelector("#readme").children[0].remove();
@roy2220
roy2220 / dummy.go
Created September 4, 2020 16:14
Make vim-go unhappy
package main
import "fmt"
func main() {
fmt.Println("vim-go")
fmt.Println("vim-go")
fmt.Println("vim-go")
fmt.Println("vim-go")
fmt.Println("vim-go")
@roy2220
roy2220 / asyncio_ssl_example.py
Created May 25, 2018 04:08 — forked from messa/asyncio_ssl_example.py
Python asyncio + SSL TCP client/server example
#!/usr/bin/env python3
import asyncio
import multiprocessing
import os
import ssl
from time import sleep
port = 9000
@roy2220
roy2220 / tcp-nodelay-test.c
Created November 4, 2017 03:52 — forked from gregorycollins/tcp-nodelay-test.c
Is TCP_NODELAY inherited from listening sockets on your platform?
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <stdlib.h>
#include <stdio.h>
#include <strings.h>
#include <sys/socket.h>
#include <sys/types.h>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIWhiteColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGKSpYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKcHCBMXGyImVSRudWxs1QkKCwwNDg8QERJcTlNDb21wb25lbnRzVU5TUkdCXE5T
Q29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29sb3JTcGFjZVYkY2xhc3NPECgwLjAyNzQ1MTAw
NjcgMC4yMTE3NjQ3MjMxIDAuMjU4ODIzNDg0MiAxTxAoMC4wMzkzODA3NDc4MiAwLjE2
import bisect
class ConsistentHashTable(object):
_SUBKEYS_PER_KEY = 64
def __init__(self):
self._key_to_hashcodes = {}
self._all_hashcodes = []
self._hashcode_to_value = {}
#!/bin/python2
import subprocess
import json
import os
import re
HOSTS_FILE_NAME = "/etc/hosts"
MARK_BEGIN_DOCKER_CONTAINERS = "# -- begin docker containers --"
MARK_END_DOCKER_CONTAINERS = "# -- end docker containers --"
#cloud-config
ssh_authorized_keys:
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDag6q5/PFQ/cjxTqYjVfM7VXxIdZBDK5DO/JEXcwQLrnRq0+Uk4xt9noSF+xLyfA9QNrDe9BQ7LeZu2iId1091CEKC2/BAfdoN/asHNNuTvL+/iQSbOBM/M6ozNV9c2xgORGAA0Oq/W0wTx6vZ9/ZM7rQnj9pLbzuDqbuCll+mH1hVDlNDrlvY9xT2sFroWv3kFkyqFKX+TV+RNR3EItsXfKLxuHTmarRltipoTdoFh4wBwHRfBHSYaGQb2PFC35Oe32BvOmkeH46B2as85Rii4moe6bkgzv9UE9Sb9zjJHK9Z2iuy70T9E4vBMMbjh0uRJyMO5G8yuMuskN7MU2Pj roy@ada"
$(function() {
var onOff = true;
var commentManager = null;
videojs.plugin('commentManager', function () {
if (commentManager != null) {
return commentManager;
}
var commentRegion = $('<div>').addClass('container')