Skip to content

Instantly share code, notes, and snippets.

View Quezler's full-sized avatar
🍪
crater desires cookies.

Patrick 'Quezler' Mounier Quezler

🍪
crater desires cookies.
  • Netherlands
  • 15:54 (UTC +02:00)
View GitHub Profile
This file has been truncated, but you can view the full file.
9254835974458887629672873635789957411886024698554157393849494864228024962939550688297074527198420261051675205999609689838587412
7948702662533481896767559573369920938242346354580061545409242090168773727371802699309443935396635866263937828773324526334321892
7929250312741837331511829643632683169694074912332726993582394725302853411901337696207186358524323117172520907433878952968176465
9486937364148093931718552300016332142708943190856638524388888569011747617956915519539025796115901484762122047712200094207683584
0703675740855407318047361595661595146837376373951978537785605481083388906490085533348547865459237835407372374738389274773789264
3524314516560200536698529022539598732463389124803873184044464663165630452635665559603483233341839268186056673186867104904449866
3388466377320953222057779182433549144340237502432464295061371141084500222833875925546082542869030852833895137466510262849050187
2359980877010447170873386178573828860442255448874794721230413368694441497441338856684036949118353204002591974711928301953002372
@zentala
zentala / formatBytes.js
Created September 27, 2017 11:57
Convert size in bytes to human readable format (JavaScript)
function formatBytes(bytes,decimals) {
if(bytes == 0) return '0 Bytes';
var k = 1024,
dm = decimals || 2,
sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
}
// Usage:
@DeflatedPickle
DeflatedPickle / MinecraftEnergyTypes.md
Last active May 5, 2024 12:10
A simple table for Minecraft energy types and a matrix for conversion rates.

Minecraft Energy Types


Energy Name Abbreviation Original Mod Version
Anima AM Anima-Mundi 1.11.2
Blutricity BE (NO) Redpower 1.6.4
Charge RP (NO)/Fz? Factorization 1.7.10
Crystal Flux CF Actually Additions 1.12
@fgilio
fgilio / axios-catch-error.js
Last active April 11, 2024 19:02
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@judy2k
judy2k / parse_dotenv.bash
Created March 22, 2017 13:34
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@sam-artuso
sam-artuso / setting-up-babel-nodemon.md
Last active November 3, 2023 08:52
Setting up Babel and nodemon

Setting up Babel and nodemon

Inital set-up

Set up project:

mkdir project
cd project
npm init -y
@C5H8NNaO4
C5H8NNaO4 / whatsapp-web-online-notifier.js
Last active August 10, 2023 23:30
WhatsApp Web - Displays Desktop Notifications when a user gets online [console]
(function (window) {
var DOUBLE_CLICK_DELAY = 550;
var OnlineNotifier = (function () {
var LOG_LEVEL = 01;
var POLL_TIMEOUT = 1E3;
var MIN_TIMEOUT = 60E3;
var MIN_TIMEOUT_TYPING = 5E3
var DEBUG_CHECK_ALL = false;
var DEBUG_CHECK_ONLINE = false;
var DEBUG_CHECK_TYPING = false;
@phillipsharring
phillipsharring / Kernel.php
Last active October 9, 2023 13:11 — forked from kkiernan/MySqlDump.php
Laravel Artisan command to perform MySQL Dump using database connection information in the .env file. Posted 2016 Jan. Unsupported. Forked from https://gist.github.com/kkiernan/bdd0954d0149b89c372a
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
@fullybaked
fullybaked / usort.php
Created September 1, 2015 12:05
Usort with PHP7 Spaceship vs PHP5.6
<?php
// PHP 5.6
usort($array, function($a, $b) {
if ($a == $b) {
return 0;
}
return ($a < $b) ? -1 : 1;
});
@Yimiprod
Yimiprod / difference.js
Last active April 5, 2024 13:17
Deep diff between two object, using lodash
/**
* This code is licensed under the terms of the MIT license
*
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {