Skip to content

Instantly share code, notes, and snippets.

View rocktimsaikia's full-sized avatar
🐰
always learning

Rocktim rocktimsaikia

🐰
always learning
View GitHub Profile
@rocktimsaikia
rocktimsaikia / flw-webhook-test-response.json
Last active October 18, 2024 10:09
Webhook response of Flutterwave test mode for subscription.
{
  "id": 7667896,
  "txRef": "inv_17292345299xa50uv",
  "flwRef": "FLW-MOCK-1f2c29ac6d39368653b4a78a243fe3e9",
  "orderRef": "URF_1729234669506_2726735",
  "paymentPlan": 69699,
  "paymentPage": null,
  "createdAt": "2024-10-18T06:57:49.000Z",
  "amount": 83550,
  "charged_amount": 83550,
@rocktimsaikia
rocktimsaikia / razorpay-supported-currencies.json
Created July 31, 2024 14:42
Razorpay supported currencies
[
{
"Currency Name": "United Arab Emirates Dirham",
"ISO Code": "AED"
},
{
"Currency Name": "Albanian lek",
"ISO Code": "ALL"
},
{
@rocktimsaikia
rocktimsaikia / yt.md
Last active December 15, 2023 05:12
Fav programming YT vids
@rocktimsaikia
rocktimsaikia / README.md
Last active November 29, 2023 09:20 — forked from aidos-dev/README.md
Connect Apple AirPods to Linux (Ubuntu)

Connect Apple AirPods to Linux (Ubuntu)

# 1. Open the below file with vim
sudo vim /etc/bluetooth/main.conf

# 2. Change the value of this field to bredr
ControllerMode = bredr

# 3. Save and Exit from Vim.
@rocktimsaikia
rocktimsaikia / vim-cheats.md
Created October 29, 2022 07:54 — forked from Starefossen/vim-cheats.md
My vim cheat sheet for working with tabs and window splits.

Tabs

New Tab

  • :tabnew - new blank tab
  • :tabedit [file] - open file in tab

Cursor Movement

  • gt (:tabn) - next tab

Tmux cheatsheet

ctrl+b+" = Splits the window horizantally
ctrl+c+% = Splits the window vertically
ctrl+d = Drop the current pane
ctrl+b+<arrows> = to switch between pages
ctrl+b+z = Zoom in and out in the current pane
ctrl+b+c = Create a new window
ctrl+b+p = Go to the previous window
ctrl+b+n = Go to the next window \

@rocktimsaikia
rocktimsaikia / process.js
Created March 9, 2022 16:33
Node uptime in HH:MM:SS
const uptime = new Date(Math.floor(process.uptime()) * 1000).toISOString().substr(11, 8)

Keybase proof

I hereby claim:

  • I am rocktimsaikia on github.
  • I am rocktimcodes (https://keybase.io/rocktimcodes) on keybase.
  • I have a public key ASAuQYTNFSXBEjGqCDGvRT2LVEDf48FlHEvoVSBnk1I_ggo

To claim this, I am signing this object:

@rocktimsaikia
rocktimsaikia / invert.js
Last active March 11, 2021 06:27
Invert an array of integers
// Inverts the integers of an array
const invert = arr => arr.map(n => -n);
invert([2,-5]); //=> [-2,5]
@rocktimsaikia
rocktimsaikia / paginate.md
Last active January 14, 2021 15:31
🔥 How to paginate in mongodb using mongoose

🔥 Here is how to paginate in MongoDB using mongoose :

// Here it is hardcoded for example but 
// generally the `pageNum` should come from request query param
const pageNum = 2;
const pageSize = 10;

// pagination formula
const paginate = (pageNum - 1) * pageSize;