This file contains 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 convertToRoman(inputNum) { | |
var letters = ['I', 'V', 'X', 'L', 'C', 'D', 'M']; | |
var digits = String(inputNum).split('').reverse(); | |
var roman = []; | |
for (var i = 0, length = digits.length; i < length; i++) { | |
var value = Number(digits[i]); | |
var splitStart = i * 3 - i; |
This file contains 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
local AppendLists in | |
fun {AppendLists L1 L2} | |
local Aux in | |
fun {Aux List Acc} | |
case List of | |
Head|Tail then {Aux Tail (Head | Acc)} | |
else Acc | |
end | |
end | |
{Aux {Reverse L1} L2} |
This file contains 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
defmodule Pinner do | |
def first do | |
case 10 do | |
# `x` sempre dá match porque sendo ele | |
# uma variável, representa-se que qualquer | |
# valor arbitrário pode ser aceito no caso | |
x -> | |
"x" | |
10 -> | |
"10" |
This file contains 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
// How to download telegram sticker images | |
/* | |
1. Go to Telegram Web; | |
2. Open console (F12); | |
3. Paste the code below in the console and press Enter; | |
4. Open your stickers menu and make sure you see the sticker pack you want to download (so Telegram will load it). | |
5. At the console paste and run "downloadStickers()" any time you want to download a pack. | |
6. [Convert .webm to another format](http://www.freewaregenius.com/convert-webp-image-format-jpg-png-format/); | |
7. Happy hacking. |
This file contains 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
<h1 id="page">No Page</h1> | |
<button data-page="Home" data-delay="1000">Home</button> | |
<button data-page="Users" data-delay="1500">Users</button> | |
<button data-page="Posts" data-delay="3000">Posts</button> |
This file contains 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 $page = document.getElementById('page') | |
const setPage = title => { | |
$page.innerText = title | |
} | |
const loadPage = (title, time) => | |
new Promise(resolve => | |
setTimeout(() => resolve(title), time) | |
) |
This file contains 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 $page = document.getElementById('page') | |
let currentPage = 'no-page' | |
const setPage = title => { | |
if (currentPage !== title) return; | |
$page.innerText = title | |
} | |
const loadPage = (title, time) => | |
new Promise(resolve => |
This file contains 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 $page = document.getElementById('page') | |
let currentPage = 0 | |
const setPage = title => { | |
$page.innerText = title | |
} | |
const loadPage = (title, time) => | |
new Promise(resolve => | |
setTimeout(() => resolve(title), time) |
This file contains 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 $page = document.getElementById('page') | |
const router = { | |
listeners: [], | |
onPageChange(fn) { | |
this.listeners.push(fn) | |
} | |
} |
This file contains 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
var counter = 0 | |
function count() { | |
return counter++ | |
} |
OlderNewer