Skip to content

Instantly share code, notes, and snippets.

View wakingyeung's full-sized avatar
:octocat:
code code code

Waking wakingyeung

:octocat:
code code code
View GitHub Profile
@dims
dims / README.md
Last active November 13, 2025 15:42
Kubernetes Resources
@wakingyeung
wakingyeung / lock.py
Last active September 5, 2021 03:55
Distributed locks with Redis for Python.
#!/usr/bin/env python
# -*- coding=utf-8 -*-
import math
import time
import uuid
import redis
@wakingyeung
wakingyeung / snowflake.py
Last active October 20, 2025 17:56
Twitter snowflake id generator for Python.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import multiprocessing
import re
import threading
import time
LAST_TIMESTAMP = -1
SEQUENCE = 0
"""
Django ORM Optimization Tips
Caveats:
* Only use optimizations that obfuscate the code if you need to.
* Not all of these tips are hard and fast rules.
* Use your judgement to determine what improvements are appropriate for your code.
"""
# ---------------------------------------------------------------------------
@bradtraversy
bradtraversy / docker-help.md
Last active November 23, 2025 10:14
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

kubectl get services # List all services
kubectl get pods # List all pods
kubectl get nodes -w # Watch nodes continuously
kubectl version # Get version information
kubectl cluster-info # Get cluster information
kubectl config view # Get the configuration
kubectl describe node <node> # Output information about a node
kubectl get pods # List the current pods
kubectl describe pod <name> # Describe pod <name>
kubectl get rc # List the replication controllers
@jpswade
jpswade / devops_best_practices.md
Last active December 8, 2025 09:02
Devops Best Practices Checklist

Find the original here article here: Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, at the Agile Conference in Toronto, Andrew Shafer posted an offer to moderate an ad hoc "Birds of a Feather" meeting to discuss the topic of "Agile Infrastructure". Only one person showed up to discuss the topic: Patrick Debois. Their discussions and sharing of ideas with others advanced the concept of "agile systems administration". Debois and Shafer formed an Agile Systems Administrator group on Google, with limited success. Patrick Debois did a presentation called "Infrastructure and Operations" addressing

@bigsergey
bigsergey / review-checklist.md
Last active November 5, 2025 13:06
Front-end Code Review Checklist

Review checklist

General

  1. Does the code work?
  2. Description of the project status is included.
  3. Code is easily understand.
  4. Code is written following the coding standarts/guidelines (React in our case).
  5. Code is in sync with existing code patterns/technologies.
  6. DRY. Is the same code duplicated more than twice?