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
// Place your key bindings in this file to overwrite the defaults | |
[ | |
{ | |
"key": "ctrl+\\", | |
"command": "workbench.action.toggleSidebarVisibility" | |
}, | |
{ | |
"key": "ctrl+b", | |
"command": "-workbench.action.toggleSidebarVisibility" | |
}, |
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
#!/bin/sh | |
# This pre-commit hook will prevent you from committing any line (or filename) containing | |
# the string NOCOMMIT. Use that tag in comments around source code you want to avoid | |
# accidentally committing, like temporary IP addresses or debug printfs. | |
# | |
# To add it to an existing repository, save it to .git/hooks/pre-commit (or append, if | |
# that file already exists). Remember to make executable (chmod +x ...) | |
# | |
# To automatically add this pre-commit hook to every repository you create or clone: |
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
Math.random().toString(36).split('0.')[1] |
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
let origLog = window.console.log | |
window.console.debugMode = true | |
window.console.log = function () { | |
if (!window.console.debugMode) return | |
for (let i = 0; i < arguments.length; i++) { | |
origLog(arguments[i]) | |
} | |
} | |
console.log({dsa: 1}, 'dsadsa', 12321) |
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
// ** Demo code ** | |
var p = document.querySelector('p'), | |
input = document.querySelector('input'); | |
function setText(v){ | |
p.innerHTML = formatBytes(v); | |
} | |
// bind 'input' event | |
input.addEventListener('input', function(){ | |
setText( this.value ) |
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
apt-get install $(grep -vE "^\s*#" apt-requirements.txt | tr "\n" " ") |
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
def merge_dicts(*dict_args): | |
""" | |
Given any number of dicts, shallow copy and merge into a new dict, | |
precedence goes to key value pairs in latter dicts. | |
This function will work in Python 2 and 3 for all dicts. | |
e.g. given dicts a to g: z = merge_dicts(a, b, c, d, e, f, g) | |
Key value pairs in g will take precedence over dicts a to f, and so on. | |
https://stackoverflow.com/questions/38987/how-to-merge-two-dictionaries-in-a-single-expression | |
""" | |
result = {} |
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
# i3status configuration file. | |
# see "man i3status" for documentation. | |
# It is important that this file is edited as UTF-8. | |
# The following line should contain a sharp s: | |
# ß | |
# If the above line is not correctly displayed, fix your editor first! | |
general { | |
interval = 5 |
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 regex = /^(?:https?:\/\/w*\.?)?([a-zA-Z0-9\.\-_]+)(?:[\/.\-_a-zA-Z0-9]*)$/; | |
const str = `https://test.google.com/testdsadsa`; | |
let m; | |
if ((m = regex.exec(str)) !== null) { | |
// The result can be accessed through the `m`-variable. | |
m.forEach((match, groupIndex) => { | |
console.log(`Found match, group ${groupIndex}: ${match}`); | |
}); | |
} |