Skip to content

Instantly share code, notes, and snippets.

View mrpeski's full-sized avatar
💣
I just had to try it Out

Olayinka Ogunwemimo mrpeski

💣
I just had to try it Out
View GitHub Profile
@muffycompo
muffycompo / base64_url_safe.php
Created July 10, 2014 23:05
PHP Helper functions for Safe Base64 URL encode
<?php
function base64url_encode($data) {
return rtrim(strtr(base64_encode($data), '+/', '-_'), '=');
}
function base64url_decode($data) {
return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT));
}
?>
@tuxfight3r
tuxfight3r / vim-shortcuts.md
Last active May 27, 2025 09:33
VIM SHORTCUTS

VIM KEYBOARD SHORTCUTS

MOVEMENT

h        -   Move left
j        -   Move down
k        -   Move up
l        -   Move right
$        -   Move to end of line
0        -   Move to beginning of line (including whitespace)
@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active May 20, 2025 11:56
Vanilla JavaScript Quick Reference / Cheatsheet
@alvr
alvr / packages.md
Last active March 21, 2025 09:05
Available Packages

Available Packages:

Path Version Description
add-ons;addon-google_apis-google-15 3 Google APIs
add-ons;addon-google_apis-google-16 4 Google APIs
add-ons;addon-google_apis-google-17 4 Google APIs
add-ons;addon-google_apis-google-18 4 Googl
@Danziger
Danziger / interval.hook.ts
Last active November 15, 2023 18:00
✨ Declarative useTimeout (setTimeout), useInterval (setInterval) and useThrottledCallback (useCallback combined with setTimeout) hooks for React (in Typescript)
import React, { useEffect, useRef } from 'react';
/**
* Use setInterval with Hooks in a declarative way.
*
* @see https://stackoverflow.com/a/59274004/3723993
* @see https://overreacted.io/making-setinterval-declarative-with-react-hooks/
*/
export function useInterval(
callback: React.EffectCallback,
@mrpeski
mrpeski / downloadItem.js
Created September 28, 2022 17:38
Code snippet for downloading files programmatically on the browser
function downloadItem(url) {
var reader = new FileReader();
fetch(url).then((response) => {
return response.blob()
}).then((respBlob) => {
reader.readAsDataURL(respBlob);
reader.onloadend = function() {
let elem = document.createElement('a');
elem.download = "true";
elem.href = reader.result;