Skip to content

Instantly share code, notes, and snippets.

@mustafa0x
mustafa0x / rand_emoji.sh
Created February 14, 2023 18:39
terminal title: set to random emoji (add to ~/.bashrc)
# useful for finding the right tab quickly. thanks to jordan for the help.
readonly -a emojis=(😄 😃 😀 😊 ☺ 😉 😍 😘 😚 😗 😙 😜 😝 😛 😳 😁 😔 😌 😒 😞 😣 😢 😂 😭 😪 😥 😰 😅 😓 😩 😫 😨 😱 😠 😡 😤 😖 😆 😋 😷 😎 😴 😵 😲 😟 😦 😧 😈 👿 😮 😬 😐 😕 😯 😶 😇 😏 😑 👲 👳 👮 👷 💂 👶 👦 👧 👨 👩 👴 👵 👱 👼 👸 😺 😸 😻 😽 😼 🙀 😿 😹 😾 👹 👺 🙈 🙉 🙊 💀 👽 💩 🔥 ✨ 🌟 💫 💥 💢 💦 💧 💤 💨 👂 👀 👃 👅 👄 👍 👎 👌 👊 ✊ ✌ 👋 ✋ 👐 👆 👇 👉 👈 🙌 🙏 ☝ 👏 💪 🚶 🏃 💃 👫 👪 👬 👭 💏 💑 👯 🙆 🙅 💁 🙋 💆 💇 💅 👰 🙎 🙍 🙇 🎩 👑 👒 👟 👞 👡 👠 👢 👕 👔 👚 👗 🎽 👖 👘 👙 💼 👜 👝 👛 👓 🎀 🌂 💄 💛 💙 💜 💚 ❤ 💔 💗 💓 💕 💖 💞 💘 💌 💋 💍 💎 👤 👥 💬 👣 💭 🐶 🐺 🐱 🐭 🐹 🐰 🐸 🐯 🐨 🐻 🐷 🐽 🐮 🐗 🐵 🐒 🐴 🐑 🐘 🐼 🐧 🐦 🐤 🐥 🐣 🐔 🐍 🐢 🐛 🐝 🐜 🐞 🐌 🐙 🐚 🐠 🐟 🐬 🐳 🐋 🐄 🐏 🐀 🐃 🐅 🐇 🐉 🐎 🐐 🐓 🐕 🐖 🐁 🐂 🐲 🐡 🐊 🐫 🐪 🐆 🐈 🐩 🐾 💐 🌸 🌷 🍀 🌹 🌻 🌺 🍁 🍃 🍂 🌿 🌾 🍄 🌵 🌴 🌲 🌳 🌰 🌱 🌼 🌐 🌞 🌝 🌚 🌑 🌒 🌓 🌔 🌕 🌖 🌗 🌘 🌜 🌛 🌙 🌍 🌎 🌏 🌋 🌌 🌠 ⭐ ☀ ⛅ ☁ ⚡ ☔ ❄ ⛄ 🌀 🌁 🌈 🌊 🎍 💝 🎎 🎒 🎓 🎏 🎆 🎇 🎐 🎑 🎃 👻 🎅 🎄 🎁 🎋 🎉 🎊 🎈 🎌 🔮 🎥 📷 📹 📼 💿 📀 💽 💾 💻 📱 ☎ 📞 📟 📠 📡 📺 📻 🔊 🔉 🔈 🔇 🔔 🔕 📢 📣 ⏳ ⌛ ⏰ ⌚ 🔓 🔒 🔏 🔐 🔑 🔎 💡 🔦 🔆 🔅 🔌 🔋 🔍 🛁 🛀 🚿 🚽 🔧 🔩 🔨 🚪 🚬 💣 🔫 🔪 💊 💉 💰 💴 💵 💷 💶 💳 💸 📲 📧 📥 📤 ✉ 📩 📨 📯 📫 📪 📬 📭 📮 📦 📝 📄 📃 📑 📊 📈 📉 📜 📋 📅 📆 📇 📁 📂 ✂ 📌 📎 ✒ ✏ 📏 📐 📕 📗 📘 📙 📓 📔 📒 📚 📖 🔖 📛 🔬 🔭 📰 🎨 🎬 🎤 🎧 🎼 🎵 🎶 🎹 🎻 🎺 🎷 🎸 👾 🎮 🃏 🎴 🀄 🎲 🎯 🏈 🏀 ⚽ ⚾ 🎾 🎱 🏉
@mustafa0x
mustafa0x / qpc-pg-003.html
Last active February 11, 2021 06:34
qpc-pg-003
<!doctype html>
<meta charset=utf-8>
<style>
svg {
display: inline-block;
width: 1em;
height: 1em;
stroke-width: 0;
stroke: currentColor;
@mustafa0x
mustafa0x / finder.sh
Created November 16, 2014 06:56
Image Magick Sub Image Search
for f in haystack/*.jpg; do
echo $'\n'"Searching in '$f'";
compare -dissimilarity-threshold 1 -metric rmse -subimage-search "$f" needle.png results-"$(basename ${f%.jpg})"-%d.png
done
@mustafa0x
mustafa0x / codeeval.js
Created March 12, 2013 15:22
CodeEval solutions. Updated as additional problems are solved.
/**
* FizzBuzz
*/
function codeEvalExecute(line) {
var spec = line.split(" ").map(function(x, i) {
return +x; // Cast to int
}), i = 1, out = "", cur = "";
for (; i <= spec[2]; i++) {
if (i !== 1)
cur = " ";
@mustafa0x
mustafa0x / wp-reset.php
Last active December 14, 2015 05:40
A simple script which backups up and restores a WordPress setup.
<?php
/**
* This is a simple script which backups up and resets
* a WordPress setup (or more specifically, a folder and database).
*
* Begin by installing and setuping up WordPress as you wish to freeze it.
* Once you've done so, create the backup. Make changes as you wish.
* When you wish to reset, simply visit this script and press the reset button.
*
* Note that this script assumes you know what you're doing.
@mustafa0x
mustafa0x / codemirror-ll.js
Created April 1, 2012 15:55
CodeMirror Lazy Load
var __CODEMIRROR_LOADED, __LOAD_COUNT = 0, __CODEMIRROR_MODE, __CODEMIRROR;
codeMirrorClick = function(syntax){
/*
* Check if syntax has been changed.
*
* If it has, we have to load the files
* for the new syntax.
*/
if (syntax != __CODEMIRROR_MODE)