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 base64 | |
| import random | |
| import tkinter as tk | |
| from io import BytesIO | |
| from tkinter import filedialog, messagebox | |
| from PIL import Image | |
| from pillow_heif import register_heif_opener |
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
| // ==UserScript== | |
| // @name SO copy code snippet | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description Adds copy button to code snippets | |
| // @author me | |
| // @match https://stackoverflow.com/questions/* | |
| // @icon https://www.google.com/s2/favicons?domain=stackoverflow.com&sz=64 | |
| // @grant none | |
| // @require https://cdnjs.cloudflare.com/ajax/libs/cash/8.1.1/cash.min.js |
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
| // ==UserScript== | |
| // @name Ctrl+Enter executes for programmers.co.kr | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1 | |
| // @description try to take over the world! | |
| // @author You | |
| // @match https://school.programmers.co.kr/learn/courses/*/lessons/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=programmers.co.kr | |
| // @grant none | |
| // ==/UserScript== |
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 deepEqual(a, b) { | |
| // Handle edge cases and primitives using Object.is | |
| if (Object.is(a, b)) return true; | |
| // Handle arrays | |
| const isArray = Array.isArray(a) && Array.isArray(b); | |
| const isTypedArray = ArrayBuffer.isView(a) && ArrayBuffer.isView(b); | |
| if (isArray || isTypedArray) { | |
| if (isTypedArray) { | |
| // Check if both are of the same type |
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 | |
| # Environment check | |
| # If migrating from localhost, set this to localhost | |
| if [[ ! $SOURCE_HOST_ADDRESS ]] | |
| then | |
| echo "Please set the current host address in SOURCE_HOST_ADDRESS" | |
| exit 1 | |
| 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
| canon_map = { | |
| "a": ["ร", "รฅ", "ฤ", "ฤ ", "ฦ", "ว", "ษ", "ฮ", "ฮ", "ฮฌ", "ฮฑ", "ฮป", "ะ", "ะฐ", "ิน", "เธ", "แ", "แ", "แฏ", "แ", "แฑ", "แ ", "แฉ", "แด", "แดฌ", "แต", "โ", "โณ", "โบ", "โ", "ๅ", "๊ฒ", "๊ซ", "๊ฌ", "๊", "๊ช", "๏ฝ", "๏พ", "๐", "๐", "๐", "๐ถ", "๐ช", "๐", "๐", "๐", "๐บ", "๐ฎ", "๐ข", "๐", "๐", "๐", "๐ผ", "๐ถ", "๐ฐ", "๐ช", "๐ฐ", "๐ ", "๐ ฐ", "๐ฆ\u200c",], | |
| "b": ["ร", "ฦ", "ฦ", "ษ", "ษฎ", "ส", "ฮฒ", "ฯ", "ฯฆ", "ะ", "ะฌ", "ะฑ", "ะฒ", "า", "ี ", "เธฟ", "เน", "เน", "แฆ", "แฉ", "แช", "แ", "แ", "แฐ", "แฒ", "แฏ", "แท", "แ", "แฅ", "แดฎ", "แต", "โ", "โญ", "ไน", "๊", "๊ฒ", "๊ณ", "๊ฐ", "๊", "๊", "๊ช", "๏ฝ", "๐", "๐", "๐", "๐", "๐ท", "๐ซ", "๐", "๐", "๐", "๐ป", "๐ฏ", "๐ฃ", "๐", "๐", "๐ฑ", "๐ ", "๐ ฑ", "๐ง\u200c",], | |
| "c": ["ยข", "รง", "ฤ", "ฤ", "ฦ", "ฦ", "ศผ", "ฯ", "ฯฒ", "ั", "ี", "เฅฎ", "เซฎ", "แ", "แ", "แญ", "แ", "แ", "แฃ", "แ", "แข", "แค", "แฏ", "แฅด", "แจถ", "แด", "แถ", "โก", "โต", "โ", "โ ฝ", "โ", "โพ", "โฒฅ", "ใ", "ๅ", "๊ฏ", "๊", "๊", "๊", "๊ณ", "๊ธ", "๊", "๊ฎฏ", "๏ฝ", "๐ฝ", "๐จ", "๐", "๐", "๐", "๐ธ", "๐ฌ", "๐ ", "๐", "๐", "๐ผ", "๐ฐ", "๐ค", "๐", "๐", "๐ฒ", "๐ ", "๐ ฒ", "๐จ\u200c",], | |
| "d": ["ร", "ฤ", "ฤ", "ฤ", "ฦ", " |
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
| from time import sleep, time | |
| import os | |
| def binary_search(condition, low, high): | |
| if callable(condition) and high > low: | |
| mid = int((high + low) / 2) | |
| res = condition(mid) |
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
| package kr.co.benew.iddle_admin.servlet; | |
| import java.io.IOException; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.function.BiFunction; | |
| import java.util.function.UnaryOperator; | |
| import javax.servlet.ServletResponse; | |
| import javax.servlet.http.HttpServletResponse; |
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 json_format = (jsons, level = 2) => { | |
| let i = 0 | |
| return JSON.stringify(JSON.parse(jsons)).replace(/\[\]|\{\}|[{[,\]}]/g, | |
| c => ['[]', '{}'].includes(c) ? c : '{[,'.includes(c) ? c + '\n' + (','.includes(c) ? ' '.repeat(i * level) : ' '.repeat(++i * level)) : '\n' + ' '.repeat(--i * level) + c) | |
| .replace(/"(?:[^"]|\\")+"(:)/g, '$& ') | |
| } |
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 iterateNode = (rootNode, [attrVisitor, textVisitor]) => { | |
| if (rootNode instanceof Node) { | |
| for(const node of rootNode.childNodes) { | |
| if (node instanceof Element) { | |
| for (const attr of node.attributes) { | |
| attrVisitor.call(null, attr) | |
| } | |
| iterateNode(node, [attrVisitor, textVisitor]) | |
| } else if (node instanceof Text) { | |
| textVisitor.call(null, node) |
NewerOlder