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
| Function.prototype.log = function () { | |
| function annotate(func) { | |
| return (func + "") | |
| .replace(/[/][/].*$/gm, "") | |
| .replace(/\s+/g, "") | |
| .replace(/[/][*][^/*]*[*][/]/g, "") | |
| .split("){", 1)[0] | |
| .replace(/^[^(]*[(]/, "") | |
| .replace(/=[^,]+/g, "") | |
| .split(",") |
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
| :root{ | |
| --aliceblue-50: #F8F8F9; | |
| --aliceblue-100: #F2F2F2; | |
| --aliceblue-200: #DDDEDF; | |
| --aliceblue-300: #C9CBCC; | |
| --aliceblue-400: #A1A3A6; | |
| --aliceblue-500: #787C80; | |
| --aliceblue-600: #6C7073; | |
| --aliceblue-700: #484A4D; | |
| --aliceblue-800: #36383A; |
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
| function url(u) { | |
| const GITHUB_API_URL = "https://api.github.com"; | |
| const TEMPLATES = [ | |
| [ | |
| /^(https?):\/\/gitlab\.com\/([^\/]+.*\/[^\/]+)\/(?:raw|blob)\/(.+?)(?:\?.*)?$/i, | |
| "$1://gl.githack.com/$2/raw/$3", | |
| ], | |
| [ | |
| /^(https?):\/\/bitbucket\.org\/([^\/]+\/[^\/]+)\/(?:raw|src)\/(.+?)(?:\?.*)?$/i, |
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 | |
| ######################################################## | |
| # Get data from spotify api # | |
| ######################################################## | |
| sudo rm -rf _temp && mkdir _temp && cd _temp; | |
| pwd && ls |
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
| async function run(){var e;try{e=await(e=>new Promise((a,t)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=(()=>a(r.result)),r.onerror=(e=>t(e))}))(await async function(){return new Promise(e=>{var a=document.createElement("input");a.style.display="none",a.type="file",a.accept="image/*",document.body.appendChild(a),a.onchange=(t=>{e(a.files[0]),a.remove()}),a.click()})}())}catch(e){return alert("No file selected")}if(!e)return alert("No data generated");var a=await fetch("https://uploads.explosionscratc.repl.co/upload",{method:"POST",body:e}).then(e=>e.json());if(console.log(a),a.error)return alert(`There was an error: ${a.message}`);var t=document.createElement("textarea");document.body.appendChild(t),t.value=a.link,t.focus(),t.select(),document.execCommand("copy"),t.remove()}run(); |
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
| javascript: { | |
| var container = | |
| document.querySelector("article") || | |
| document.querySelector("#readme .Box-body article") || | |
| document.querySelector("#readme") || | |
| document.querySelector(".page"); | |
| if (document.querySelector(".final-path")) { | |
| var header = document.createElement("h1"); | |
| header.innerText = document.querySelector(".final-path").innerText; |
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 {translated} = await translate("bonjour"); | |
| // --> "Hello" | |
| async function translate(text, target, source) { | |
| var opts = { | |
| text: text || "", | |
| source: source || 'auto', | |
| target: target || "en", | |
| } | |
| var result = await fetch(`https://translate.googleapis.com/translate_a/single?client=gtx&sl=${opts.source}&tl=${opts.target}&dt=t&q=${encodeURI(opts.text)}`).then(res => res.json()); | |
| 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
| async function answer(q) { | |
| var html = await fetch( | |
| `https://cors.explosionscratc.repl.co/google.com/search?q=${encodeURI(q)}`, | |
| { | |
| headers: { | |
| "User-Agent": | |
| "Mozilla/5.0 (X11; CrOS x86_64 13982.88.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.162 Safari/537.36", | |
| }, | |
| } | |
| ).then((res) => res.text()); |
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> | |
| import {onMount} from "svelte"; | |
| export let link = ""; | |
| let m, title, description, img, img_el; | |
| onMount(async () => { | |
| m = await meta(link); | |
| m = parseMeta(m); | |
| title = m.title; | |
| description = m.description; | |
| img = m.image; |
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
| function htmlToImage(html, { x = 0, y = 0, width = 300, height = 400 }) { | |
| let canvas = document.createElement("canvas"); | |
| canvas.width = width; | |
| canvas.height = height; | |
| var ctx = canvas.getContext("2d"); | |
| return new Promise((res) => { | |
| var xml = toXML(html); | |
| xml = xml.replace(/\#/g, "%23"); | |
| var data = `data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}"><foreignObject width="100%" height="100%">${xml}</foreignObject></svg>`; |