Skip to content

Instantly share code, notes, and snippets.

View MZanggl's full-sized avatar
🐊

Michael MZanggl

🐊
View GitHub Profile
@MZanggl
MZanggl / bookmark.js
Created May 14, 2020 05:16
inspect-layout (add as bookmark)
javascript: (function() { var styleEl = document.getElementById('css-layout-hack'); if (styleEl) { styleEl.remove(); return; } styleEl = document.createElement('style'); styleEl.id = 'css-layout-hack'; styleEl.innerHTML = '* { background:#000!important;color:#0f0!important;outline:solid%20#f00%201px!important;%20background-color:%20rgba(255,0,0,.2)%20!important;%20}\%20%20%20%20%20*%20*%20{%20background-color:%20rgba(0,255,0,.2)%20!important;%20}\%20%20%20%20%20*%20*%20*%20{%20background-color:%20rgba(0,0,255,.2)%20!important;%20}\%20%20%20%20%20*%20*%20*%20*%20{%20background-color:%20rgba(255,0,255,.2)%20!important;%20}\%20%20%20%20%20*%20*%20*%20*%20*%20{%20background-color:%20rgba(0,255,255,.2)%20!important;%20}\%20%20%20%20%20*%20*%20*%20*%20*%20*%20{%20background-color:%20rgba(255,255,0,.2)%20!important;%20}\%20%20%20%20%20*%20*%20*%20*%20*%20*%20*%20{%20background-color:%20rgba(255,0,0,.2)%20!important;%20}\%20%20%20%20%20*%20*%20*%20*%20*%20*%20*%20*%20{%20background-color:%20rgba(0,255,0,.2)%20!import
@MZanggl
MZanggl / keybindings.json
Last active May 1, 2020 06:09
vscode minimalist settings
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "shift+cmd+'",
"command": "workbench.action.terminal.new"
},
{
"key": "ctrl+shift+`",
"command": "-workbench.action.terminal.new"
},
@MZanggl
MZanggl / main.js
Last active February 26, 2020 04:49
access vue route root
Vue.mixin({
computed: {
$routeRoot() {
if (this.$route && this.$route.matched.length > 0) {
return this.$route.matched[0].instances.default
}
}
}
});
@MZanggl
MZanggl / tsconfig.json
Last active December 26, 2019 00:18
simple ts configurations for ES5 compilation
{
"compilerOptions": {
"lib": ["ES2020"],
"target": "ES5",
"module": "CommonJS",
"outDir": "./dist",
"baseUrl": "./src",
"strict": true,
"declaration": true
},
@MZanggl
MZanggl / settings.json
Created December 13, 2019 05:25
vs code settings
{
"workbench.sideBar.location": "right",
"workbench.iconTheme": "material-icon-theme",
"window.zoomLevel": 0,
"terminal.external.osxExec": "bash",
"editor.lineHeight": 33,
"editor.fontFamily": "'Operator Mono', Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
"breadcrumbs.enabled": true,
"editor.fontSize": 15,
@MZanggl
MZanggl / aliases.sh
Last active September 28, 2020 03:19
git common aliases
git config --global alias.amend "commit --amend --no-edit"
git config --global alias.update "pull --rebase origin develop"
git config --global alias.nah "! git reset --hard && git clean -df"
git config --global alias.commit-crime "commit -n"
git config --global alias.alias "! git config --get-regexp ^alias\. | sed -e s/^alias\.// -e s/\ /\ =\ /"
git config --global alias.arrange "rebase -i develop"
git config --global alias.recent "branch --sort=-committerdate" # most recent branches
git config --global alias.stash-unstaged "stash save --keep-index -u"
git config --global alias.undo-commit "reset HEAD~ --soft"
@MZanggl
MZanggl / es6-rest-with-typescript-check.js
Last active July 1, 2018 04:20
ts-check function with ES6 Rest parameter
// @ts-check
/**
* @param {number[]} numbers
*/
function sum(...numbers) {
return numbers.reduce((result, addition) => result + addition, 0);
}
sum(1, 2, 3, 4); // OK