Skip to content

Instantly share code, notes, and snippets.

View mingyc's full-sized avatar

Ming-Ying Chung mingyc

  • Tokyo, Japan
  • 07:03 (UTC +09:00)
View GitHub Profile
@olets
olets / zsh-plugin-manager-plugin-installation-procedures.md
Last active May 18, 2024 21:40
zsh plugin manager cross-reference

Instructions for installing zsh plugins, for a variety of plugin managers

  • antibody: Add <owner>/<repo> to your plugins file. If you use static loading update the sh.

  • Antigen: Add antigen bundle <owner>/<repo> to your .zshrc.

  • Oh-My-Zsh:

    • Clone to OMZ's plugins' directory:
@calexandre
calexandre / merge-zsh-history.sh
Last active May 9, 2024 15:56
Merge two zsh history files
#!/bin/bash
# Inspired on https://david-kerwick.github.io/2017-01-04-combining-zsh-history-files/
set -e
history1=$1
history2=$2
merged=$3
echo "Merging history files: $history1 + $history2"
test ! -f $history1 && echo "File $history1 not found" && exit 1
@fntsrlike
fntsrlike / ProGit-zh-translation.md
Last active March 11, 2024 12:26
《Pro Git》第二版中文文件翻譯對照表與規範

《Pro Git》第二版中文文件翻譯對照表與規範

由於原本 Pro Git zh-tw 翻譯社群共筆的服務 hackpad 已經停止運作,並被移植到 Dropbox Paper。為了有利於本份資料在社群共享、傳播,故將其從 Dropbox Paper 輸出,並存在 Gist 備存。

相關議題可以參照 progit/progit2-zh-tw#38#39

前言

很慶幸的,有各位熱心的夥伴參與翻譯,其實就算是單人翻譯的狀況,常常會發生有些專有名詞或者是格式上前後不一的狀況。所以開了一個 pad 專門記錄這些規範以及參考的翻譯對照表。有些是我個人的一些想法,如果夥伴們有其他的意見跟想法歡迎提出來討論。 關於專有名詞翻譯的部分,我能理解部分夥伴會覺得就保留英文即可,但我會希望文件也類似於中文翻譯書般,第一次出現時我們可以以 專有名詞中文翻譯 (英文原文)的呈現方式來表示,讓讀者可以產生中英關聯,之後同份文件再次出現將只會出現中文翻譯。這樣做是因為對於初學者來說不會因為滿滿的英文專有名詞而產生抗拒。當然前提是在於中文的翻譯是否能夠達意,這部分建議參考對岸的一些翻譯,有時候比我們Pro Git的還直觀。但對於像 Laravel, Composer 等是名字、指令等就不強求要中文對照,這類不會有統一翻法更不容易從翻譯中知道用意的,就保留英文即可。如果不清楚該怎麼翻才好也可以留著與大家討論。

anonymous
anonymous / untrusted-lvl17-solution.js
Created April 25, 2014 20:55
Solution to level 17 in Untrusted: http://alex.nisnevich.com/untrusted/
/***************
* pointers.js *
***************
*
* You! How are you still alive?
*
* Well, no matter. Good luck getting through this
* maze of rooms - you'll never see me or the Algorithm again!
*/
anonymous
anonymous / untrusted-lvl12-solution.js
Created April 25, 2014 19:41
Solution to level 12 in Untrusted: http://alex.nisnevich.com/untrusted/
/*
* robotNav.js
*
* The green key is located in a slightly more
* complicated room. You'll need to get the robot
* past these obstacles.
*/
function startLevel(map) {
// Hint: you can press R or 5 to "rest" and not move the
@justecorruptio
justecorruptio / 2048.c
Created April 4, 2014 03:49
Tiny 2048 in C!
M[16],X=16,W,k;main(){T(system("stty cbreak")
);puts(W&1?"WIN":"LOSE");}K[]={2,3,1};s(f,d,i
,j,l,P){for(i=4;i--;)for(j=k=l=0;k<4;)j<4?P=M
[w(d,i,j++)],W|=P>>11,l*P&&(f?M[w(d,i,k)]=l<<
(l==P):0,k++),l=l?P?l-P?P:0:l:P:(f?M[w(d,i,k)
]=l:0,++k,W|=2*!l,l=0);}w(d,i,j){return d?w(d
-1,j,3-i):4*i+j;}T(i){for(i=X+rand()%X;M[i%X]
*i;i--);i?M[i%X]=2<<rand()%2:0;for(W=i=0;i<4;
)s(0,i++);for(i=X,puts("\e[2J\e[H");i--;i%4||
puts(""))printf(M[i]?"%4d|":" |",M[i]);W-2
@timdream
timdream / gist:5968469
Last active January 22, 2023 20:00
Github 發 Pull Request & 貢獻流程速查

Github 發 Pull Request & 貢獻流程速查

前言

此文目標讀者需先自行學會

  • 開 Github 帳號
  • 會 fork 程式 repository
  • 會在自己的電腦使用命令列 git
  • 會 clone 自己的 repository
@gmodarelli
gmodarelli / Setup Solarized for Gnome on Ubuntu 13.04.md
Last active July 14, 2020 15:59
Setup Solarized for Gnome on Ubuntu 13.04

Dark version

wget --no-check-certificate https://raw.github.com/seebi/dircolors-solarized/master/dircolors.ansi-dark
mv dircolors.ansi-dark .dircolors
eval `dircolors ~/.dircolors`

git clone https://github.com/sigurdga/gnome-terminal-colors-solarized.git
cd gnome-terminal-colors-solarized
./set_dark.sh
@pjdietz
pjdietz / Virtual Box Host Only Static IP.md
Created June 12, 2013 19:01
VirtualBox Host-Only Adapter with Static IP

VirtualBox Host-Only Static IP

My typical setup for a development box in VirtualBox uses two NICs. The first uses NAT to allow the box to communicate with the outside world through my host computer’s network connection. (NAT is the default, so shouldn't require any setup.) The second is a "host-only" connection that allows my host and guest to interact.

To create a host-only connection in VirtualBox, start by opening the preferences in VirtualBox. Go to the "Network" tab, and addd a Host-only Network. Modify the host-only network, and disable DHCP. Make a note of the IP address. (Feel free to set the IP address as well, if you like.)

Next, assign this host-only adapter to the virtual machine. Select the VM and press "Settings". Go to the "Network" tab, and select "Adpater 2". Enable the adapter, set it to a "Host-only Adapter", and select the adpater you created above.

Temporary

@willurd
willurd / web-servers.md
Last active May 23, 2024 20:20
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000