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
/* the buttons on the right of the file tabs */ | |
[id="workbench.parts.editor"] .title-actions ul > li:has(:not(.codicon-close-dirty)) { | |
display: none !important; | |
} | |
/* the buttons on the right of the window title */ | |
.titlebar-right .monaco-toolbar { | |
display: none !important; | |
} |
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 | |
function forward_container() { | |
docker run -it --rm \ | |
-p $OUTSIDE_PORT:$INSIDE_PORT \ | |
--network $NETWORK_NAME \ | |
alpine/socat \ | |
tcp-listen:$INSIDE_PORT,fork,reuseaddr tcp-connect:$CONTAINER_NAME:$INSIDE_PORT | |
} |
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
// Select the proper frame in devtools and run this script | |
const nextPageButton = Array.from(document.querySelectorAll('mat-icon')).find((e) => e.innerHTML === 'chevron_right'); | |
const getCurrentPageText = () => Array.from(document.querySelectorAll('reader-page')) | |
.filter(e => e.checkVisibility()) | |
.map((e) => e.textContent) | |
.join(''); | |
const isLastPage = () => nextPageButton.classList.contains('mat-button-disabled'); |
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 a = (prefix = '') => | |
new Proxy( | |
{}, | |
{ | |
get(_, p) { | |
const newPrefix = [prefix.toString(), p.toString()].join('.'); | |
console.log('get: ', newPrefix); | |
return a(newPrefix); | |
}, |
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
import fetch from "node-fetch"; | |
import { writeFileSync } from "fs"; | |
const HEADERS = {/* copy from chrome */}; | |
const getPurchaseItems = async (id) => { | |
console.log("getting purchase:", id); | |
const prom = fetch( | |
`https://api.carrefour.es/marketing-digital/prod/tickets/${id}`, | |
{ |
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
/** | |
* | |
* @param {any} obj The input object | |
* @param {string[]} exceptions List of keys not to convert | |
* @param {string} basePath Base string to use for the path | |
* @returns {any} Returns an object with the same structure as obj but each value is the path to the key | |
* @example pathize({a: {b: {c: 2}}, d: 3, e: 4}, ['e'], 'base') ==> {a: {b: {c: 'base.a.b.c'}}, d: 'base.a.d', e: 4} | |
*/ | |
function pathize(obj, exceptions = [], basePath = '') { | |
const clone = JSON.parse(JSON.stringify(obj)) |
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 | |
# JUST FOR EDUCATIONAL PURPOSES | |
sed -i -E 's/async check\([^\)]*\) \{/async check\(\) \{ \n return true;/g' js/simplifyGmail.js | grep -C 10 'async check' |
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/bash | |
# Usage: ./pipenvlocker [dev | all] | |
pipenv_lock_cmd='pipenv lock' | |
no_dev='--requirements > requirements.txt' | |
dev='--requirements --dev-only > requirements-dev.txt' | |
chosen="$pipenv_lock_cmd $no_dev" | |
if [ "$1" = 'dev' ]; then chosen="$pipenv_lock_cmd $dev"; fi |
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
class FuncSwarm { | |
constructor(f) { | |
this._promises = [] | |
this._res = f(p => this._promises.push(p)) | |
} | |
_waitPromises() { | |
return Promise.all([this._res.catch(() => {}), ...this._promises]) | |
} |
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
alias grgl='git remote -v get-url origin | sed -e "s/^git@/https#\/\//g" -e "s/:\//\//g" -e "s/https#\/\//https:\/\//g" -e "s/\.git$//g"' | |
alias gro='open $(grgl)' | |
alias grop='open $(grgl)/pipelines' |