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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width" /> | |
| <title>Redirecting...</title> | |
| </head> | |
| <body> | |
| <form | |
| method="post" |
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
| #!/usr/bin/env bash | |
| last_commit=$(git log --format="%h %s" -n 1) | |
| echo "this will deploy your last local commit" | |
| echo $last_commit | |
| while true; do | |
| read -p "Do you want to continue? (y/n) " yn | |
| case $yn in |
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 'dotenv/config'; | |
| import fs from 'fs'; | |
| import path from 'path'; | |
| import { fileURLToPath } from 'url'; | |
| import { MongoClient } from 'mongodb'; | |
| const DB_NAME = ''; | |
| const COLLECTION_NAME = ''; |
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
| // Find all properties & methods of an object, up to the root prototype | |
| function findAllProps(obj, props = []) { | |
| if (!obj) { | |
| return props; | |
| } | |
| return findAllProps(Object.getPrototypeOf(obj), [ | |
| ...props, | |
| Object.getOwnPropertyNames(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
| @mixin cursor-emoji($emoji) { | |
| cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='48' viewport='0 0 100 100' style='fill:black;font-size:24px;'><text y='50%'>"+$emoji+'</text></svg>') | |
| 16 0, | |
| auto; | |
| } |
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
| // Check if there's any Google foobar challenge invite in the page comments | |
| // https://www.geeksforgeeks.org/google-foo-bar-challenge/ | |
| (() => { | |
| function getAllComments() { | |
| const $root = document.documentElement; | |
| const comments = []; | |
| const iterator = document.createNodeIterator($root, NodeFilter.SHOW_COMMENT, () => NodeFilter.FILTER_ACCEPT, false); | |
| let node; | |
| while (node = iterator.nextNode()) { |
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
| // Script that shows the total price of an Airbnb listing divided by the number of persons | |
| // Inject it in any Airbnb search page (https://airbnb.com/s/*) | |
| !function() { | |
| function runner() { | |
| const persons = +new URL(window.location.href).searchParams.get('adults'); | |
| if (!persons) { | |
| return; | |
| } |
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
| // Usage: | |
| // commit ('SET', { prop: `path.to['my'].prop[1]`, value: 42 }); | |
| // or commit ('SET', [`path.to['my'].prop[1]`, 42]); | |
| export default { | |
| SET_PROP(state, payload) { | |
| let prop, value; | |
| if (Array.isArray(payload)) { | |
| [prop, value] = payload; |
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
| window.slog = function (...args) { | |
| if (!window.logsStack) { | |
| window.logsStack = []; | |
| window.printLogsStack = function () { | |
| for (const logItem of window.logsStack) { | |
| const [msg, lineDetails] = logItem; | |
| console.log(msg); | |
| console.log(lineDetails); | |
| } |
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 results; | |
| let currentWindow; | |
| let customizedWindow = {}; | |
| let iframe = document.createElement('iframe'); | |
| iframe.style.display = 'none'; | |
| document.body.appendChild(iframe); | |
| currentWindow = Object.getOwnPropertyNames(window); | |
| results = currentWindow.filter(function (prop) { | |
| return !iframe.contentWindow.hasOwnProperty(prop); |