Skip to content

Instantly share code, notes, and snippets.

View Maecenas's full-sized avatar
👋
Hi

Xiang Li Maecenas

👋
Hi
View GitHub Profile
@Maecenas
Maecenas / Dockerfile
Last active November 26, 2023 01:07
My Connection Guide for CMU 14-741/18-631: Introduction to Information Security
FROM i386/ubuntu:18.04
WORKDIR /app
RUN apt-get update \
&& apt-get install -y \
build-essential \
binutils \
gdb \
gcc-multilib \
@elsonwx
elsonwx / machotkeyinwindows
Created March 9, 2019 03:20
autohotkey映射windows快捷键为mac方式
; !代表alt +代表shit键
!q:: Send !{f4}
!w:: Send ^w
!c:: Send ^c
!v:: Send ^v
!x:: Send ^x
!z:: Send ^z
!l:: Send ^l
!f:: Send ^f
!t:: Send ^t
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active June 9, 2024 19:08
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@ttttmr
ttttmr / RSS_to_Inoreader.js
Last active March 6, 2023 17:02
一键订阅到Inoreader,相关:一键复制RSS https://gist.github.com/ttttmr/d44e40e92abb4966edcdee2e09fe8ffc
javascript: (function () {
let rsshub_host = 'https://rsshub.app';
let cnblog = 'https://www.cnblogs.com/';
let csdn = 'https://blog.csdn.net/';
let jianshu_user = '/jianshu/user/';
let zhihu_user = '/zhihu/people/activities/';
let zhihu_collection = '/zhihu/collection/';
let bilibili_user = '/bilibili/user/video/';
let jike_topic = '/jike/topic/';
@Maecenas
Maecenas / Raymond Hettinger - Beyond PEP 8 -- Best practices for beautiful intelligible code - PyCon 2015.md
Last active March 11, 2024 05:49
Raymond Hettinger - Beyond PEP 8 -- Best practices for beautiful intelligible code - PyCon 2015. Distillation of knowledge gained from a decade of Python consulting, Python training, code reviews, and serving as a core developer. (https://www.youtube.com/watch?v=wf-BqAjZb8M) <br/> https://www.shawnxli.com/posts/beyond-pep-8/

Raymond Hettinger's professional at doing code review and architecture review

P vs. NP. Pythonic vs. Non-Pythonic.

How to make use of PEP 8

  1. Golden rule of PEP-8: PEP-8 onto yourself. PEP 8 is style guide, not a law book.
  2. Care about intelligibility, not simply visually better
  3. Transforming (Java) API to pythonic ones

Why not PEP 8

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 3, 2024 12:57
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@nrollr
nrollr / nginx.conf
Last active June 9, 2024 23:39
NGINX config for SSL with Let's Encrypt certs
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration
@jez
jez / gdb-cheatsheet.md
Created September 18, 2016 20:49
GDB Cheatsheet from CS:APP Website, reformatted