This file contains 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
function calcula(op) { | |
const operations = { | |
'+': (a, b) => a + b, | |
'-': (a, b) => a - b, | |
'*': (a, b) => a * b, | |
'/': (a, b) => a / b, | |
} | |
const operation = operations[op] |
This file contains 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
Hello there |
This file contains 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] | |
status-all=for-each-ref --format="%(refname:short) %(upstream:track) (upstream:remotename)" refs/heads |
This file contains 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 Simple1DNoise { | |
#MAX_VERTICES = 256; | |
#MAX_VERTICES_MASK = this.#MAX_VERTICES - 1; | |
amplitude = 1; | |
scale = 0.5; | |
#r = []; | |
constructor() { | |
for (let i = 0; i < this.#MAX_VERTICES; ++i) { | |
this.#r.push(Math.random()); | |
} |
This file contains 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
// XMLHttpRequest.open override | |
var cors_api_host = 'cors-anywhere.herokuapp.com'; | |
var cors_api_url = 'https://' + cors_api_host + '/'; | |
var slice = [].slice; | |
var origin = window.location.protocol + '//' + window.location.host; | |
var open = XMLHttpRequest.prototype.open; | |
XMLHttpRequest.prototype.open = function() { | |
var args = slice.call(arguments); | |
var targetOrigin = /^https?:\/\/([^\/]+)/i.exec(args[1]); | |
if (targetOrigin && targetOrigin[0].toLowerCase() !== origin && |
This file contains 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
name: Build and Deploy | |
on: | |
push: | |
branches: | |
- main # change to your desired branch name | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 |
This file contains 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
docker stop `docker ps -qa` && docker rm `docker ps -qa` && docker rmi -f `docker images -qa ` && docker volume rm $(docker volume ls -qf) && docker network rm `docker network ls -q` |
This file contains 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
window.ddEventListener('click', event => { | |
const el = event.target | |
if (el.tagName.toLowerCase() === 'a') { | |
event.preventDefault() | |
const url = new URL(el.href) | |
url.searchParams.delete('fbclid') | |
window.open(url.href, el.target) | |
} | |
}, true) | |
// or |
This file contains 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
EN = 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'September', 'October', 'November', 'December' | |
PL = 'Styczeń', 'Luty', 'Marzec', 'Kwiecień', 'Maj', 'Czerwiec', 'Lipiec', 'Sierpień', 'Wrzesień', 'Październik', 'Listopad', 'Grudzień'| |
This file contains 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
function createKeyboardEvent(name, key, altKey, ctrlKey, shiftKey, metaKey, bubbles) { | |
var e = new Event(name) | |
e.key = key | |
e.keyCode = e.key.charCodeAt(0) | |
e.which = e.keyCode | |
e.altKey = altKey | |
e.ctrlKey = ctrlKey | |
e.shiftKey = shiftKey | |
e.metaKey = metaKey | |
e.bubbles = bubbles |