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 phrases = [ | |
| ["Champ,","the mere idea of you","has serious game,","24/7."], | |
| ["Fact:","your soul","rains magic,","can I get an amen?"], | |
| ["Everybody says","your hair today","deserves the Nobel Prize,","and that's a fact."], | |
| ["Dang…","everything you do","raises the roof,","so treat yourself."], | |
| ["Check it:","your personal style","breeds miracles,","you feel me?"], | |
| ["Just saying...","every thought you have","is paying off big time,","that's just science."], | |
| ["Superstar,","that sparkle in your eye","shows mad skills,","would I lie?"], | |
| ["Tiger,","your presence here","just shimmers,","for reals."], | |
| ["Self,","what you got going on","is a national treasure,","mic drop."], |
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 maxCharCode = 2 ** 16 - 1; | |
| export function compress(input: string): string { | |
| let output = ""; | |
| for (let pos = 0; pos < input.length; pos++) { | |
| const maxLookBack = Math.min(pos, maxCharCode); | |
| let didOutputMatch = false; | |
| let charsToSkip = 0; | |
| for (let back = 0; back < maxLookBack; back++) { | |
| let backLen = 0; |
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
| // | |
| // JSONWrapper.swift | |
| // | |
| // Created by Maria Zaitseva on 16.03.2021. | |
| // | |
| import Foundation | |
| /// This class provides a straightforward way to encode/decode | |
| /// objects of type `[String: Any]` to and from JSON. |
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
| ALGORITHM SHOW MESSAGE | |
| PARAMETERS T$ | |
| VARIABLES D<>; M<> | |
| START | |
| 10 IF T$ .EQ NULL THEN GOTO 70 | |
| 20 PARAMETERS T$ | |
| 30 CALL "createElement" OF DOCUMENT INTO D<> | |
| 40 SET "innerHTML" OF D<> TO T$ | |
| 50 PARAMETERS "#messageArea" | |
| 60 CALL "querySelector" OF DOCUMENT INTO M<> |
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
| export const base64Alphabet = new Array(64).fill(null).map((_, i) => btoa(String.fromCharCode(0, 0, i))[3]).join(''); |
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
| data:text/html,<script>d=document,d.querySelector('*').append(d.createTextNode(location))</script> | |
| Shorter, non-HTML5: | |
| data:text/html,<script>d=document,d.all[0].append(d.createTextNode(location))</script> |
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 python3 | |
| import time | |
| from http.server import HTTPServer | |
| from http.server import BaseHTTPRequestHandler | |
| from zipfile import ZipFile | |
| HOST_NAME = 'localhost' | |
| PORT_NUMBER = 8000 | |
| source = ZipFile('files.zip', 'r') |
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 add(arr1, arr2) { | |
| return arr1.map((x, i) => x + (arr2[i] || 0)); | |
| } | |
| function mult(arr1, arr2) { | |
| return arr1.map((x, i) => x * (arr2[i] || 0)); | |
| } | |
| function sum(arr) { | |
| return arr.reduce((acc, x) => acc + x); |
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
| [ | |
| { | |
| "name" : "Ace", | |
| "gender" : "male", | |
| "image" : "https://dodo.ac/np/images/thumb/4/4f/Ace_PG.png/30px-Ace_PG.png", | |
| "species" : "bird", | |
| "personality" : "jock" | |
| }, | |
| { | |
| "personality" : "cranky", |
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
| <style>body{--b:#0cf;--f:#fff}.d{--b:#009;--f:#ddd;background: gray}x{display:flex;justify-content:center;background:var(--b)}z{color:var(--f)}</style><x><z>wow demo<button onclick="(o=document.body).className=o.className?'':'d'">+ |