Skip to content

Instantly share code, notes, and snippets.

View weaming's full-sized avatar
🦀
Rustacean

Garden Yuen weaming

🦀
Rustacean
  • Shenzhen, China
View GitHub Profile
// ==UserScript==
// @name Shotcuts
// @namespace http://bitflow.org
// @version 0.1
// @description add shotcuts
// @match https://*/*
// @copyright 2022+, You
// ==/UserScript==
function onKey(e) {
// console.log(e, e.key);
package main
import (
"encoding/json"
"fmt"
"strings"
)
const DASH = "-"
package main
import (
"bytes"
"encoding/json"
"fmt"
"time"
)
type Duration struct {
@weaming
weaming / confirm.go
Created February 3, 2021 09:47 — forked from r0l1/confirm.go
Go (golang): How to ask for user confirmation via command line
/* MIT License
*
* Copyright (c) 2017 Roland Singer [roland.singer@desertbit.com]
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@weaming
weaming / git-aliases.bash
Last active February 5, 2021 04:51
使用 alias 提高 git 使用效率
alias gcl='git clone'
alias gs='git status'
alias gd='git diff'
alias gdc='git diff --cached'
alias gl='git lg'
alias gps='git push -u'
alias gconf='vi .git/config'
alias gamend='git commit --amend'
alias gamendy='git commit --amend --no-edit'
alias gback='git reset --hard HEAD~'
@reorx
reorx / thunderbird_customization.md
Last active July 27, 2022 15:50
Thunderbird customization configs
"""
Usage:
>>> class Color(SimpleEnum):
>>> red = KV
>>> green = 'green' # same as using `KV`
>>> grey = 'gray'
>>> Color.red
'red'
>>> Color.grey
@weaming
weaming / google-center.css
Created July 6, 2018 11:24
Make google search center on wide screen
.mw,
.tsf{
margin: 0 auto;
}
/* search tool bar */
#hdtb-msb,
#resultStats {
position: relative;
left: calc((100vw - 950px)/2);
@sebastien
sebastien / nix-fishgen.py
Last active May 31, 2021 02:52
Python script that converts Nix's profile bash script to Fish
#!/usr/bin/env python3
# Updated: 2018-10-17
import re, sys, os
"""
Converts the Nix profile SH script to a Fish-compatible profile using a
simple line-by-line replace algorithm.
"""
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active April 23, 2024 21:05
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com