Skip to content

Instantly share code, notes, and snippets.

View rfbatista's full-sized avatar
🚀

Renan Batista rfbatista

🚀
View GitHub Profile
@LeCoupa
LeCoupa / nodejs-cheatsheet.js
Last active June 30, 2024 04:14
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@damirm
damirm / shift_array_elements.js
Last active June 12, 2024 08:50
Javascript shift array elements left/right by N positions
/**
* Fast method
*/
function shift(arr, direction, n) {
var times = n > arr.length ? n % arr.length : n;
return arr.concat(arr.splice(0, (direction > 0 ? arr.length - times : times)));
}
/**
* Slow method
@lromor
lromor / tinyimagenet.py
Last active April 28, 2024 18:07
TinyImageNet Dataset for Pytorch
# Copyright (C) 2022 Leonardo Romor
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the