Skip to content

Instantly share code, notes, and snippets.

View inkydragon's full-sized avatar

Chengyu Han inkydragon

View GitHub Profile
@inkydragon
inkydragon / deep-into-repr.jl
Created July 10, 2019 06:13
Why `repr(Expr(:$, :a))` gives `":(\$(Expr(:\$, :a)))"`.
# TL; DR:
#= 1 - AST printing Rules =#
# https://github.com/JuliaLang/julia/blob/master/base/show.jl#L741-L763
## Abstract Syntax Tree (AST) printing ##
# Summary:
# print(io, ex) defers to show_unquoted(io, ex)
@inkydragon
inkydragon / testset.jl
Last active May 1, 2019 10:39
patch for `MLStyle.jl`
# test driven development
# TestSet for `@when` + `@otherwise`
using MLStyle
using Test
using Random
#=
Test help macro/functions
=#
@inkydragon
inkydragon / Learn-Julia-zh-cn.jl
Last active April 12, 2025 05:23
Learn Julia in Y minutes 社区翻译版。讨论帖:http://discourse.juliacn.com/t/topic/611
# 单行注释由「#」号开始
#= 以「#=」开头,用「=#」结尾就可以得到多行注释
多行注释可以嵌套。
=#
# VSC 代码高亮 patch'
####################################################
## 1. 原始类型与操作符
####################################################
@inkydragon
inkydragon / osu! Wiki Completion Template.md
Last active June 11, 2018 04:03
osu! Wiki Completion List Template

Wiki Completion

Articles

  • About
  • Accuracy
  • Article Styling Criteria
    • Images
    • News
  • BanchoBot
  • BBCode
@inkydragon
inkydragon / Chinese osu! Wiki Completion.md
Created June 10, 2018 12:22
Chinese osu! Wiki Completion list

Chinese Wiki Completion

Articles

  • About
  • Accuracy
  • Article Styling Criteria
    • Images
    • News
  • BanchoBot
  • BBCode
@inkydragon
inkydragon / .zshrc
Created August 7, 2017 11:57
zsh的配置文件
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/home/wo/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# 主题设置
@inkydragon
inkydragon / .vimrc
Last active August 7, 2017 11:55
vim/gvim设置
" From zhihu https://www.zhihu.com/question/19637905
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" 文本编码设置
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" encoding: Vim 内部使用的字符编码方式,包括 Vim 的 buffer (缓冲区)、菜单文
" 本、消息文本等。用户手册上建议只在 .vimrc 中改变它的值。
set encoding=utf-8
" fileencodings: Vim 启动时会按照它所列出的字符编码方式逐一探测即将打开的文
@inkydragon
inkydragon / .irbrc
Created April 24, 2017 11:08
Ruby 命令行工具 irb 的配置文件
## This is irb' conf
# https://inkydragon.github.io/Programming-Ruby-ver-2/#15-Ruby-shell
## Autocompletion
require 'irb/completion'
## Auto-indent
IRB.conf[:AUTO_INDENT] = true
## Obj check
#coding=utf-8
import hashlib
def sha1(string):
return hashlib.sha1(string).hexdigest()
def calc(strSHA1):
r = 0
for i in strSHA1: