Skip to content

Instantly share code, notes, and snippets.

@floydawong
floydawong / how-to-write-hygienic-macros.md
Created October 19, 2020 06:34 — forked from Kestrer/how-to-write-hygienic-macros.md
A guide on how to write hygienic Rust macros

How to Write Hygienic Rust Macros

Macro hygiene is the concept of macros that work in all contexts; they don't affect and aren't affected by anything around them. Ideally all macros would be fully hygienic, but there are lots of pitfalls and traps that make it all too easy to accidentally write unhygienic macros. This guide attempts to provide a comprehensive resource for writing the most hygienic macros.

Understanding the Module System

First, a little aside on the details of Rust's module system, and specifically paths; it is

@floydawong
floydawong / patch_sublime_text.sh
Created April 28, 2020 09:04
Patch Sublime Text (only tested under Windows x64, Ubuntu 18.04)
#!/usr/bin/env bash
# @see https://gist.github.com/n6333373/c15e8ae61f5e0421cf9091affb733312
# the path of the Sublime Text executable
BIN_PATH="./sublime_text.exe"
# (optional) the Data directory for non-portable mode
# such as "C:\Users\David\AppData\Roaming\Sublime Text 3"
DATA_DIR=""
patch_sublime_text_exe () {
@floydawong
floydawong / check_process_exists.sh
Created April 21, 2020 08:08
通过adb查看进程是否存在
adb shell ps | findstr com.package.name
@floydawong
floydawong / Windows
Created April 2, 2020 09:39 — forked from yabasha/Windows
Crack Sublime Text 3.2.2 Build 3211
# Subscribe to my YouTube Channel -> https://lokjianming.page.link/CVLm #
How to Crack Sublime Text 3 with Hex Editor
1. Download & Install Sublime Text 3.2.2 Build 3211
2. Visit Hexed.it
3. Open file sublime_text.exe
4. Search address 97 94 0D
5. Change to 00 00 00
6. Export File
@floydawong
floydawong / gist:653b54760fba995b8d123f9c2abc35ac
Created April 2, 2020 09:28 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@floydawong
floydawong / git-tag-delete-local-and-remote.sh
Created February 19, 2020 06:45 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@floydawong
floydawong / post-commit
Created November 11, 2019 09:36
post-commit
#!/usr/bin/env python
# _*_ coding:utf-8 _*_
# author: Floyda
import os, re
import subprocess
import sys
reload(sys)
@floydawong
floydawong / BasicTypes.ts
Created February 28, 2018 14:12
TS_BasicTypes
// Basic Types
// Boolean
let isDone: boolean = false
// Number
let decimal: number = 6
let hex: number = 0xf00d
@floydawong
floydawong / Class.ts
Last active February 28, 2018 14:19
TS_class
class Shape {
width: number;
height: number;
area: number;
color: string;
name: string;
constructor(name: string, width: number, height: number) {
this.name = name;
this.area = width * height;
this.color = "pink";
@floydawong
floydawong / interface.ts
Created February 28, 2018 12:47
TS_interface
// interface
interface Shape {
name: string;
width: number;
height: number;
color?: string;
}
function area(shape: Shape) {
var area = shape.width * shape.height;