Skip to content

Instantly share code, notes, and snippets.

View ezirmusitua's full-sized avatar
🎯
Focusing

ezirmusitua ezirmusitua

🎯
Focusing
View GitHub Profile
@ezirmusitua
ezirmusitua / use-different-key-in-same-site.md
Last active September 10, 2019 21:39
[SSH Config: Different Repo With Different Key] Use Different Key For Different In Git Repo #ssh #git

配置 SSH Config 对不同 Github Repo 使用不同的 Private Key

  1. Edit SSH Config
# edit config file
vim ~/.ssh/config
# Add Following
Host repo1
 HostName github.com
@ezirmusitua
ezirmusitua / switch-version.cmd
Created June 28, 2019 03:10
[Scoop Switch Version] Switch Target Version In Scoop, #scoop #windows
; add if not added
scoop bucket add versions
scoop install python27 python
scoop reset python27 ; switch to python2.7
scoop reset python ; switch to python3
@ezirmusitua
ezirmusitua / software-install-win10.md
Created June 28, 2019 03:08
[Update ClickOnce Trust Prompt Behavior] Fix Can Not Install Software Cause By Security Trust Setting #windows

表现: 无法安装软件, 提示 安全警告: 您的安全设置不允许将此应用程序安装到您的计算机上 修复:

  1. win + R -> regedit

  2. 打开: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\Security\TrustManager\PromptingLevel

  3. 更新: MyComputer=Enabled; LocalIntranet=Enabled; Internet=Enabled; TrustedSites=Enabled; UntrustedSites=Disabled;

@ezirmusitua
ezirmusitua / seconds-to-datetime-str.py
Created June 8, 2019 12:55
[Convert seconds to date time string] #python #time
def seconds_to_datetime_str(seconds: str, format: str = '%Y-%m-%d'):
return time.strftime(format, time.gmtime(seconds))
@ezirmusitua
ezirmusitua / remove-added-ignored-file-in-git.sh
Created May 31, 2019 02:22
[Remove Added Ignore File In Git] #git
# Reference: http://www.codeblocq.com/2016/01/Untrack-files-already-added-to-git-repository-based-on-gitignore/
# commit all changes
git commit -m "Style: Before Lint"
# remove everything from repository
git rm -r --cached .
# re-add things
git add.
@ezirmusitua
ezirmusitua / install-framework-or-library.md
Last active May 24, 2019 02:01
[Install new framework/library in webstorm] Install new framework/library in webstorm #ide #javascript
  1. 进入 Preferences | Languages & Frameworks | JavaScript | Libraries
  2. 点击 Download
  3. 选择目标并点击 Download and Install
@ezirmusitua
ezirmusitua / expect-throw.js
Created May 24, 2019 01:59
[Expect throw in test] Expect throw in jest #javascript #test
async function check() {
throw new Error('Async Function Throw Error');
}
expect('Throw Error', () => {
test('Throw', () => {
await expect(check()).rejects.toEqual(new Error('Test'))
})
})
@ezirmusitua
ezirmusitua / take-screenshot.cs
Created May 17, 2019 02:49
[Take screenshot] Take full/camera screenshot #unity
// 1. Take full screenshot
//// full screen
//// not support single camera
//// bad efficiency
void CaptureFullScreen() {
Application.CaptureScreenshot("Screenshot.png", 0);
}
Texture2D CaptureFullScreen() {
return Application.CaptureScreenshotAsTexture();
@ezirmusitua
ezirmusitua / get-screen-size.cs
Created May 17, 2019 02:41
[Get screen size] Get screen width & height #unity
Vector2 GetScreenSize() {
return new Vector2(Screen.width, Screen.height);
}
@ezirmusitua
ezirmusitua / merge-dict.py
Created May 17, 2019 02:37
[Merge dict] Merge dict #python
def merge_dict(dict1, dict2):
res = {**dict1, **dict2}
return res