This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git rm .gitattributes | |
| git add -A | |
| git reset --hard |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "plugins": [ "git", "hg", "ssh", "z", "aliases", "dircolors" ], | |
| "dircolors": { | |
| "dirs": [ | |
| [".*", "cyan", ""] | |
| ], | |
| "files": [ | |
| ["(?ix).(7z|zip|tar|gz|rar)$", "darkcyan", ""], | |
| ["(?ix).(exe|bat|cmd|py|pl|ps1|psm1|vbs|rb|reg)$", "darkgreen", ""], | |
| ["(?ix).(doc|docx|ppt|pptx|xls|xlsx|mdb|mdf|ldf)$", "magenta", ""], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| SET st2Path=C:\Program Files\Sublime Text 3\sublime_text.exe | |
| rem add it for all file types | |
| @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f | |
| @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st2Path%,0" /f | |
| @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st2Path% "%%1"" /f | |
| rem add it for folders | |
| @reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Interrupted workflow | |
| Suppose you are interrupted by an urgent fix request while you are in the middle of a large change. The files in your working tree are not in any shape to be committed yet, but you need to get to the other branch for a quick bugfix. | |
| $ git checkout feature ;# you were working in "feature" branch and | |
| $ work work work ;# got interrupted | |
| $ git commit -a -m "snapshot WIP" (1) | |
| $ git checkout master | |
| $ fix fix fix | |
| $ git commit ;# commit with real log | |
| $ git checkout feature |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int atoi(char const *c) | |
| { | |
| int r = 0; | |
| while (*c != '\0') { | |
| r = r * 10 + (*c - '\0'); | |
| c++; | |
| } | |
| return r; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| [ | |
| // Ctrl-click word select | |
| { | |
| "button": "button1", "count": 1, "modifiers": ["ctrl"], | |
| "press_command": "drag_select", | |
| "press_args": {"by": "words"} | |
| }, | |
| // Alt-click column select | |
| { | |
| "button": "button1", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/zsh | |
| adb shell wm density "$@" && adb reboot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/zsh | |
| adb shell dumpsys display | grep mBaseDisplayInfo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "always_prompt_for_file_reload": false, | |
| "always_show_minimap_viewport": false, | |
| "animation_enabled": true, | |
| "atomic_save": false, | |
| "auto_close_tags": true, | |
| "auto_complete": false, | |
| "auto_complete_commit_on_tab": false, | |
| "auto_complete_cycle": false, | |
| "auto_complete_delay": 50, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $env:Path = ".;$env:Path" | |
| # Window title: | |
| $host.ui.RawUI.WindowTitle=[Environment]::UserDomainName + "\" + [Environment]::UserName + "@" + [Environment]::MachineName | |
| # Persistent history: | |
| $HistoryFilePath = Join-Path ([Environment]::GetFolderPath('UserProfile')) .ps_history | |
| Register-EngineEvent PowerShell.Exiting -Action { Get-History | Export-Clixml $HistoryFilePath } | out-null | |
| if (Test-path $HistoryFilePath) { Import-Clixml $HistoryFilePath | Add-History } | |
| Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward |
NewerOlder