Skip to content

Instantly share code, notes, and snippets.

View riderx's full-sized avatar
🏠
Working from home

Martin DONADIEU riderx

🏠
Working from home
View GitHub Profile
@bdlowery
bdlowery / wip-streak.js
Created June 4, 2024 01:05
WIP_streak
// Replace with your API key
const API_KEY = "wip_sk_{YOUR_API_KEY_HERE}";
const API_URL = `https://api.wip.co/v1/users/me.json?api_key=${API_KEY}`;
// Function to fetch data from the API
async function fetchStreakData() {
let request = new Request(API_URL);
let response = await request.loadJSON();
return response;
}
@sindresorhus
sindresorhus / esm-package.md
Last active November 15, 2024 15:20
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@tranquan
tranquan / xcode-keybindings-as-vscode.md
Last active November 5, 2024 00:58
Xcode KeyBindings as VSCode
@emotality
emotality / duplicate_line_xcode.md
Last active April 6, 2024 04:23
Xcode - Duplicate Line key binding

NOTE (2022-07-09): Xcode finally added this functionality in Xcode 14, please see release notes here:

New Features in Xcode 14 Beta 3
When editing code, the Edit > Duplicate menu item and its corresponding keyboard shortcut now duplicate the selected text — or the line that currently contains the insertion point, if no text is selected. (8614499) (FB5618491)


Xcode line duplicate

Bind keys to duplicate lines in Xcode

@rymawby
rymawby / stripe-credit-card-numbers.md
Last active October 18, 2024 16:25
Stripe test credit card numbers for use in development

#Test credit card numbers to use when developing with Stripe

4242424242424242 Visa

4012888888881881 Visa

4000056655665556 Visa (debit)