Skip to content

Instantly share code, notes, and snippets.

View wilbeibi's full-sized avatar
:octocat:

Hongyi Shen wilbeibi

:octocat:
View GitHub Profile
@Kestrer
Kestrer / how-to-write-hygienic-macros.md
Created October 17, 2020 05:35
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

@ian-whitestone
ian-whitestone / notes.md
Last active March 1, 2023 01:45
Best practices for presto sql

Presto Specific

  • Don’t SELECT *, Specify explicit column names (columnar store)
  • Avoid large JOINs (filter each table first)
    • In PRESTO tables are joined in the order they are listed!!
    • Join small tables earlier in the plan and leave larger fact tables to the end
    • Avoid cross joins or 1 to many joins as these can degrade performance
  • Order by and group by take time
    • only use order by in subqueries if it is really necessary
  • When using GROUP BY, order the columns by the highest cardinality (that is, most number of unique values) to the lowest.
@santisbon
santisbon / Search my gists.md
Last active June 30, 2024 12:57
How to search gists.

Enter this in the search box along with your search terms:

Get all gists from the user santisbon.
user:santisbon

Find all gists with a .yml extension.
extension:yml

Find all gists with HTML files.
language:html

@baryon
baryon / ss.yml
Last active November 26, 2023 04:27
在海外翻墙回国听音乐。IOS版Wingy使用的自定义配置YAML
adapter:
#ss代理, 在国内购买一台云服务器,安装好ShadowSocks代理服务器,iPhone版安装Wingy APP (SMART LIMITED的深蓝紫色免费版)。使用的本文的自定义配置YAML
- id: proxyAdapter
type: ss
#修改ss_host为服务器地址
host: ss_host
#修改ss_port为端口号
port: ss_port
#修改ss_password为密码
password: ss_password
@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@KodrAus
KodrAus / Profile Rust on Linux.md
Last active November 14, 2023 17:19
Profiling Rust Applications

Profiling performance

Using perf:

$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg

NOTE: See @GabrielMajeri's comments below about the -g option.

Flask-Ask Live Presentation Over the Web

The creator of Flask-Ask will show your group of 3 or more how easy it is to program the Amazon Echo with Python!

You ask 'Alexa' to play songs, get the weather, and report scores. Those 'skills', as they're called, have an open API for building conversational apps. That API is the Alexa Skills Kit, and Flask-Ask is a Python framework that makes working with it easy.

Developing with Flask-Ask is fun. It's a novel experience to write and test conversational code,

@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@vasanthk
vasanthk / System Design.md
Last active July 6, 2024 18:35
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
# Reference:
https://www.cloudgear.net/blog/2015/5-minutes-kubernetes-setup/
# install homebrew and cask
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install virtualbox
brew cask install virtualbox
# install dockertoolbox