Skip to content

Instantly share code, notes, and snippets.

@aclarknexient
aclarknexient / .iterm-colours.zsh
Last active March 19, 2024 03:51
Set iTerm2 tab colours based on the command you are running
# A dotfile to turn iTerm2 tabs a different colour based on the command glob.
# Useful for marking different environments in different colours.
# Cargo-culted from multiple sources, apologies for not fully acknowledging them :(
# Edit the line that reads "if [[ "$1" =~ "^(login-helper) " ]]; then" and replace
# "login-helper" with whatever command you use to authenticate. Then modify the case
# statement to match your auth command's arguments. For example: you may use a script
# called "authsaml" to authenticate, and its arguments are dev, test, preprd, and prd.
# Change the colour function you call if you want to change tab colours.
@Pickman-Model
Pickman-Model / Mysql 版中国省市区数据表.sql
Created July 27, 2016 13:39
Mysql 版中国省市区数据表,单表结构,数据完备和错误需要自己验证
DROP TABLE IF EXISTS `db_yhm_city`;
CREATE TABLE `db_yhm_city` (
`class_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`class_parent_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`class_name` varchar(120) NOT NULL DEFAULT '',
`class_type` tinyint(1) NOT NULL DEFAULT '2',
PRIMARY KEY (`class_id`),
KEY `class_parent_id` (`class_parent_id`),
KEY `class_type` (`class_type`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
@AveYo
AveYo / .. MediaCreationTool.bat ..md
Last active March 19, 2024 03:50
Universal MediaCreationTool wrapper for all MCT Windows 10 versions - MOVED TO github.com/AveYo/MediaCreationTool.bat
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/37.0.2062.94 Chrome/37.0.2062.94 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/8.0.8 Safari/600.8.9
Mozilla/5.0 (iPad; CPU OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12H321 Safari/600.1.4
Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240
Mozilla/5.0 (Windows NT 6.3; WOW64; rv:40.0)
@ihoneymon
ihoneymon / how-to-write-by-markdown.md
Last active March 19, 2024 03:43
마크다운(Markdown) 사용법

[공통] 마크다운 markdown 작성법

영어지만, 조금 더 상세하게 마크다운 사용법을 안내하고 있는
"Markdown Guide (https://www.markdownguide.org/)" 를 보시는 것을 추천합니다. ^^

아, 그리고 마크다운만으로 표현이 부족하다고 느끼신다면, HTML 태그를 활용하시는 것도 좋습니다.

1. 마크다운에 관하여

@szobov
szobov / config.el
Created January 18, 2021 07:48
emacs: Google-style docstring in python
(defun python-google-docstring ()
"Generate google-style docstring for python."
(interactive)
(if (region-active-p)
(progn
(call-process-region (region-beginning) (region-end) "python3" nil t t "/home/szobov/bin/scripts/format-g-docs.py")
(message "Docs are generated")
(deactivate-mark))
(message "No region active; can't generate docs!"))
)
@zhjuncai
zhjuncai / z_demo_structdescr.abap
Last active March 19, 2024 03:39
abap demo use of cl_abap_structdescr to get list of structure component definition
*&---------------------------------------------------------------------*
*& report z_demo_structdescr
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
report z_demo_structdescr.
// Processing code by Etienne Jacob
// motion blur template by beesandbombs, explanation/article: https://bleuje.com/tutorial6/
// See the license information at the end of this file.
// see result here: https://mastodon.social/@bleuje/111706027080323463
//////////////////////////////////////////////////////////////////////////////
// Start of template
int[][] result; // pixel colors buffer for motion blur
@Joelkang
Joelkang / Dockerfile
Last active March 19, 2024 03:31
Dockerfile to create a container with the right deps to quantize models with MLC for CUDA 12.1
FROM nvidia/cuda:12.1.1-devel-ubuntu22.04 as deps
SHELL ["/bin/bash", "--login", "-c"]
# Step 1. Set up Ubuntu
RUN apt update && apt install --yes wget ssh git git-lfs vim
# NOTE: libcuda.so.1 doesn't exist in NVIDIA's base image, link the stub file to work around
RUN ln -s /usr/local/cuda/lib64/stubs/libcuda.so /usr/lib/x86_64-linux-gnu/libcuda.so.1
WORKDIR /root
@halcat0x15a
halcat0x15a / pipe.md
Last active March 19, 2024 03:30
Pipe

Pipeモナドの紹介

Scalaの記事です。Haskellはあまり書けません。

Iterateeの複雑さから開放されたいのでPipe系ライブラリ使いましょうという記事です。

Iterateeとの比較や簡単な使い方についてつらつらと書いていきます。

Iterateeについて