Created
October 26, 2014 10:21
-
-
Save alxarch/bc3d799af59caa97ab8a to your computer and use it in GitHub Desktop.
Greek to greeklish for MySQL
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
| DELIMITER $$ | |
| CREATE DEFINER=`root`@`localhost` FUNCTION `greeklish`(input text charset utf8) RETURNS text CHARSET utf8 | |
| BEGIN | |
| DECLARE result text charset utf8 DEFAULT ''; | |
| DECLARE len INT(4) DEFAULT 0; | |
| DECLARE pos INT(4) DEFAULT 1; | |
| DECLARE letter VARCHAR(10) charset utf8; | |
| SET input = LOWER(input); | |
| SET len = CHAR_LENGTH(input); | |
| SET input = REPLACE(input, "ου", 'u'); | |
| SET input = REPLACE(input, "ού", 'i'); | |
| SET input = REPLACE(input, "αι", 'e'); | |
| SET input = REPLACE(input, "αί", 'i'); | |
| SET input = REPLACE(input, "οί", 'i'); | |
| SET input = REPLACE(input, "υι", 'i'); | |
| SET input = REPLACE(input, "υί", 'i'); | |
| SET input = REPLACE(input, "οι", 'i'); | |
| SET input = REPLACE(input, "ει", 'i'); | |
| SET input = REPLACE(input, "εί", 'i'); | |
| SET input = REPLACE(input, "γκ", 'g'); | |
| SET input = REPLACE(input, "γγ", 'g'); | |
| SET input = REPLACE(input, "γυ", 'y'); | |
| SET input = REPLACE(input, "γι", 'y'); | |
| SET input = REPLACE(input, "ντ", 'd'); | |
| SET input = REPLACE(input, "μπ", 'b'); | |
| SET input = REPLACE(input, "αυ", 'af'); | |
| SET input = REPLACE(input, "αύ", 'af'); | |
| SET input = REPLACE(input, "ευ", 'ef'); | |
| SET input = REPLACE(input, "εύ", 'ef'); | |
| WHILE (pos <= len) DO | |
| SET letter = SUBSTRING(input, pos, 1); | |
| CASE TRUE | |
| WHEN letter IN('α','ά') THEN SET letter = 'a'; | |
| WHEN letter IN('ε','έ') THEN SET letter = 'e'; | |
| WHEN letter IN('ο', 'ό', 'ω','ώ') THEN SET letter = 'o'; | |
| WHEN letter IN('ί','ι','ϊ','ΐ','η', 'ή', 'υ','ύ','ϋ','ΰ') THEN SET letter = 'i'; | |
| WHEN letter = 'β' THEN SET letter = 'b'; | |
| WHEN letter = 'γ' THEN SET letter = 'g'; | |
| WHEN letter = 'δ' THEN SET letter = 'd'; | |
| WHEN letter = 'ζ' THEN SET letter = 'z'; | |
| WHEN letter = 'θ' THEN SET letter = 'th'; | |
| WHEN letter = 'κ' THEN SET letter = 'k'; | |
| WHEN letter = 'λ' THEN SET letter = 'l'; | |
| WHEN letter = 'μ' THEN SET letter = 'm'; | |
| WHEN letter = 'ν' THEN SET letter = 'n'; | |
| WHEN letter = 'ξ' THEN SET letter = 'x'; | |
| WHEN letter = 'π' THEN SET letter = 'p'; | |
| WHEN letter = 'ρ' THEN SET letter = 'r'; | |
| WHEN letter IN('σ', 'ς') THEN SET letter = 's'; | |
| WHEN letter = 'τ' THEN SET letter = 't'; | |
| WHEN letter = 'φ' THEN SET letter = 'f'; | |
| WHEN letter = 'χ' THEN SET letter = 'ch'; | |
| WHEN letter = 'ψ' THEN SET letter = 'ps'; | |
| ELSE | |
| SET letter = letter; | |
| END CASE; | |
| SET result = CONCAT(result, letter); | |
| SET pos = pos + 1; | |
| END WHILE; | |
| RETURN result; | |
| END$$ | |
| DELIMITER ; |
arjunchaudhry376-ui
commented
Mar 3, 2026
<title>💛 Surprise Question 💛</title>
<style>
body {
margin: 0;
font-family: 'Segoe UI', sans-serif;
background: linear-gradient(135deg, #ff9a9e, #fad0c4);
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
overflow: hidden;
color: #fff;
text-align: center;
position: relative;
}
</style>
<script>
// Step Animation
let steps = ['step1','step2','step3','step4'];
let delay = 1500;
function showStep(i) {
if(i < steps.length) {
document.getElementById(steps[i]).style.opacity = 1;
setTimeout(() => {
showStep(i + 1);
}, delay);
} else {
document.getElementById('question').style.display = 'block';
document.getElementById('buttons').style.display = 'block';
}
}
window.onload = () => showStep(0);
// Reveal Answer with Hearts & Confetti
function reveal(answer) {
document.getElementById('buttons').style.display = 'none';
let surpriseText = answer === 'YES' ? "💖 Yay! You’re mine! 💖" : "😢 Oh… maybe next time!";
document.getElementById('surprise').textContent = surpriseText;
document.getElementById('surprise').style.display = 'block';
createHearts(20);
startConfetti();
}
// Floating Hearts
function createHearts(count) {
for(let i=0;iheart.remove(),5000);
}
}
// Confetti Effect
const canvas = document.getElementById('confetti');
const ctx = canvas.getContext('2d');
let W = canvas.width = window.innerWidth;
let H = canvas.height = window.innerHeight;
let confettiParticles = [];
function ConfettiParticle(){
this.x = Math.random()*W;
this.y = Math.random()*H- H;
this.r = Math.random()*6+4;
this.d = Math.random()*H;
this.color = "hsl(" + Math.random()*360 + ", 100%, 50%)";
this.tilt = Math.random()*10 -10;
this.tiltAngleIncremental = Math.random() * 0.07 + 0.05;
this.tiltAngle = 0;
}
function initConfetti(){
confettiParticles = [];
for(let i=0;i<150;i++){
confettiParticles.push(new ConfettiParticle());
}
}
function drawConfetti(){
ctx.clearRect(0,0,W,H);
confettiParticles.forEach(p=>{
ctx.beginPath();
ctx.lineWidth = p.r/2;
ctx.strokeStyle = p.color;
ctx.moveTo(p.x + p.tilt + p.r/4, p.y);
ctx.lineTo(p.x + p.tilt, p.y + p.tilt + p.r/4);
ctx.stroke();
});
updateConfetti();
}
function updateConfetti(){
confettiParticles.forEach(p=>{
p.tiltAngle += p.tiltAngleIncremental;
p.y += (Math.cos(p.d) + 3 + p.r/2)/2;
p.tilt = Math.sin(p.tiltAngle) * 15;
if(p.y > H){ p.y = -10; p.x = Math.random()*W;}
});
}
let confettiInterval;
function startConfetti(){
initConfetti();
confettiInterval = setInterval(drawConfetti, 20);
setTimeout(()=>clearInterval(confettiInterval), 7000);
}
window.addEventListener('resize', ()=>{
W = canvas.width = window.innerWidth;
H = canvas.height = window.innerHeight;
});
</script>
⏳ Loading Question…
💓 Checking Your Heart…
🔐 Unlocking Surprise…
📝 Preparing Final Question…
✨ Are you… my girlfriend? 💛😳
Generate gifr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment