Skip to content

Instantly share code, notes, and snippets.

View nomomon's full-sized avatar
🧇
⊂(´・◡・⊂ )∘˚˳°

Mansur Nurmukhambetov nomomon

🧇
⊂(´・◡・⊂ )∘˚˳°
View GitHub Profile
@nomomon
nomomon / KhanAcademyHacks.js
Last active September 3, 2021 05:15
Bookmarklet to get answers to Khan Academy math problems
(function(ns, fetch){
if(typeof fetch !== 'function') return;
console.log("🌱%c Khan Academy%c Hack is%c ON %c \nBy: https://github.com/nomomon", "text-shadow: 0.5px 0.5px 0 black, -0.5px -0.5px 0 black; color: white;", "color:black;", "color:green;", "color:black;");
ns.fetch = function(){
var out = fetch.apply(this, arguments);
out.then(res =>{
if(res.url.indexOf("getAssessmentItem")+1){
res.clone().json().then(data => {
console.log(JSON.parse(data.data.assessmentItem.item.itemData).question)
@nomomon
nomomon / youtubeSpeed.js
Last active August 18, 2021 15:08
Bookmarklet to set custom speed to YouTube videos
(() => {
speed = prompt("speed?");
if(speed !== null){
document.querySelector(".html5-main-video").playbackRate=speed;
}
})();
@nomomon
nomomon / browserAwake.js
Last active August 18, 2021 15:06
Bookmarklet to prevent screen from sleeping on a webpage. An alert message is send when the wake lock is released (tab was changed; browser not in focus).
(async () => {
wakeLock = await navigator.wakeLock.request('screen');
wakeLock.addEventListener('release', (e) => {
alert("Wake lock released");
});
})();
@nomomon
nomomon / reloadPageTimeout.js
Last active August 18, 2021 15:06
Bookmarklet to reload a page in a give time
(() => {
let t = prompt("exit in what time? (min)");
if(t !== null){
setTimeout(() => {
location.href = location.origin;
}, t * 60 * 1000)
}
})();