Skip to content

Instantly share code, notes, and snippets.

View akirayu101's full-sized avatar
🥅
Focusing

Akira Yu akirayu101

🥅
Focusing
  • Bytedance
  • Hangzhou.China
View GitHub Profile
@chadselph
chadselph / patternmatching.py
Last active February 15, 2024 14:45
Functional language style pattern matching in python with a decorator
from collections import defaultdict
class BadMatch(NameError):
"""Exception when your args don't match a pattern"""
pass
class Any(object):
"""
>>> 'wutup' == Any()
True
@Deco
Deco / coroutine_scheduler.lua
Created February 13, 2012 16:38
Lua Coroutine Scheduler
pcall(require,"socket")
local coroutine_scheduler = {
_NAME = "coroutine_scheduler.lua"
_VERSION = "1.0.0",
}
local Scheduler
do Scheduler = setmetatable({}, {
__call = function(class)
@zyxar
zyxar / exercise.tour.go
Last active January 15, 2025 06:09
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
@jedy
jedy / create_animation_plist.py
Last active December 14, 2015 15:08
创建cocos2d逐帧动画脚本
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import plistlib
import sys
import os.path
import re
@bradley219
bradley219 / .gitignore
Last active March 31, 2025 16:42
PID C++ implementation
.DS_Store
@killercup
killercup / pandoc.css
Created July 3, 2013 11:31
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
GSSAPIAuthentication no
ServerAliveInterval 60
Host *
ControlMaster auto
ControlPath ~/.ssh/%h-%p-%r
ControlPersist yes