Skip to content

Instantly share code, notes, and snippets.

View Congee's full-sized avatar
🤔
Focus

Changsheng Wu Congee

🤔
Focus
View GitHub Profile
@Congee
Congee / libcpuid.rb
Created May 28, 2016 11:42
Homebrew formula for libcpuid
class Libcpuid < Formula
desc "A small C library for x86 CPU detection and feature extraction "
homepage "https://github.com/anrieff/libcpuid"
head "https://github.com/anrieff/libcpuid.git"
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "autoconf" => :build
def install
hello world
@Congee
Congee / singleton.py
Created September 22, 2022 19:46
Python Singleton
from typing import Any, Callable, ParamSpec, Type, TypeVar
T = TypeVar('T')
P = ParamSpec('P')
def singleton(cls: Type[T]) -> Callable[P, T]:
"""
Example:
>>> @singleton
... class C: ...