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
| const escapeXml = (str) => ( | |
| str.replace(/[<>&'"]/g, (char) => ({ | |
| '<': '<', | |
| '>': '>', | |
| '&': '&', | |
| "'": ''', | |
| '"': '"', | |
| }[char])) | |
| ); |
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
| # mappings to have up and down arrow searching through history: | |
| "\e[A": history-search-backward | |
| "\e[B": history-search-forward | |
| # mappings to have left and right arrow go left and right: | |
| "\e[C": forward-char | |
| "\e[D": backward-char | |
| # mapping to have [Tab] and [Shift]+[Tab] to cycle through all the possible completions: | |
| "\t": menu-complete | |
| "\e[Z": menu-complete-backward |
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
| # Your init script | |
| # | |
| # Atom will evaluate this file each time a new window is opened. It is run | |
| # after packages are loaded/activated and after the previous editor state | |
| # has been restored. | |
| # | |
| # An example hack to log to the console when each text editor is saved. | |
| # | |
| # atom.workspace.observeTextEditors (editor) -> | |
| # editor.onDidSave -> |
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
| # add to your home directory (https://coderwall.com/p/_-ypzq/git-bash-fixing-it-with-alias-and-functions) | |
| function gitbranch() { | |
| ~/Projects/market;git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset);(%(color:green)%(committerdate:relative)%(color:reset))' | column -t -s ';' | |
| } | |
| function gitgui() { | |
| cd ~/Projects/market; git gui; | |
| } |
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
| /* global $ */ | |
| /** | |
| * Set the rules for a strong password. | |
| * @param {Object} rules | |
| * @param {(number|{value:number,message:string})} [rules.min=8] minimum character length (optional custom error message) | |
| * @param {(boolean|{value:boolean,message:string})} [rules.number=false] must have number? (optional custom error message) | |
| * @param {(boolean|{value:boolean,message:string})} [rules.uppercase=false] must have uppercase? (optional custom error message) | |
| * @param {(boolean|{value:boolean,message:string})} [rules.special=false] must have special char? (optional custom error message) | |
| * @param {(RegExp[]|{value:RegExp[],message:string})} [rules.blacklist=RegExp[]] array of banned password patterns (optional custom error message) |
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
| Windows Registry Editor Version 5.00 | |
| [-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder] | |
| [-HKEY_CLASSES_ROOT\Directory\shell\Cmder] |
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
| const eventStore = {}; | |
| export default class Events { | |
| static on(eventName, handler) { | |
| eventStore[eventName] = eventStore[eventName] || []; | |
| eventStore[eventName].push(handler); | |
| return this; | |
| } | |
| static trigger(eventName, data) { |