Skip to content

Instantly share code, notes, and snippets.

Avatar
🦀
Rustacean

Garden Yuen weaming

🦀
Rustacean
View GitHub Profile
View str-as-marshaljson-of-time-duration.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"time"
)
type Duration struct {
@weaming
weaming / confirm.go
Created Feb 3, 2021 — forked from r0l1/confirm.go
Go (golang): How to ask for user confirmation via command line
View confirm.go
/* 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 Feb 5, 2021
使用 alias 提高 git 使用效率
View git-aliases.bash
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 Jul 20, 2019
Thunderbird customization configs
View thunderbird_customization.md
View simple_enum.py
"""
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 Jul 6, 2018
Make google search center on wide screen
View google-center.css
.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 Sep 25, 2020
Python script that converts Nix's profile bash script to Fish
View nix-fishgen.py
#!/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.
"""
@shellexy
shellexy / NoCSS.js
Created Jan 6, 2018
去除网页样式的 bookmarklet 书签工具
View NoCSS.js
javascript:
(function(){
if (f=document.querySelector('frame[name="Main"]')) {
window.location.href = f.src;
}
document.body.style.margin = "10%";
document.body.style.lineHeight = "2em";
document.body.bgColor = "#F5F5B5";
document.body.text = "#000000";
@douglasmiranda
douglasmiranda / install.sh
Last active Oct 23, 2019
After Install Ubuntu 17.10 - Chrome, Fish Shell, Docker, Docker Compose
View install.sh
sudo apt update
sudo apt upgrade -y
# Remember: install / verify additional drivers
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo apt update
# google chrome and chrome extension to use gnome extensions
@oliveratgithub
oliveratgithub / emojis.json
Last active Mar 3, 2021
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
View emojis.json
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "👩‍👩‍👧‍👧", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "👩‍👩‍👧‍👦", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "👩‍👩‍👦‍👦", "category": "People & Body (family)", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "👨‍👩&z