Skip to content

Instantly share code, notes, and snippets.

View projektorius96's full-sized avatar
🐢
Turtles do code

LG projektorius96

🐢
Turtles do code
View GitHub Profile
@projektorius96
projektorius96 / greeter.js
Created November 8, 2022 15:15 — forked from mhofman/greeter.js
ES Module Dynamic export
const greeters = {
'en': 'english',
'fr': 'french'
};
const promise = (async () => {
const greeter = greeters[navigator.language.split('-')[0]];
if (!greeter) {
throw new Error('No greeter for you!');
@kettanaito
kettanaito / README.md
Last active July 21, 2024 23:17
Chromium on Vercel (serveless)

Chromium on Vercel (serverless)

This is an up-to-date guide on running Chromium in Vercel serverless functions in 2022. What you will read below is the result of two days of research, debugging, 100+ failed deployments, and a little bit of stress.

Getting started

Step 1: Install dependencies

Use chrome-aws-lambda that comes with Chromium pre-configured to run in serverless, and puppeteer-core due to the smaller size of Chromium distributive.

@sindresorhus
sindresorhus / esm-package.md
Last active July 23, 2024 10:30
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.
@danieldogeanu
danieldogeanu / RenameGitBranch.md
Last active June 11, 2024 12:27
How to rename your Git master branch to main.

To rename your Git master branch to main, you must do the following steps:

  1. Navigate to your repository in the command line and issue the following commands: - git branch -m master main - git push -u origin main

  2. Change your default branch on GitHub by going to your GitHub repository in your browser, and navigate to Settings > Branches and click on the dropdown and switch from master to main and click Update (this will only show if you have two or more branches). The main branch is now your default branch.

  3. Update the tracking of the branch from your command line with the following command: - git branch -u origin/main main

@peltho
peltho / svelte.md
Last active May 16, 2024 03:44
Svelte cheatsheet
@alandsilva26
alandsilva26 / GCC.md
Last active June 7, 2024 18:40
Instructions for installing GCC Compiler on Windows

Installation

To check if GCC already exists by running the following command in your command promt gcc -v

  • Install MSYS2 MSYS2.

  • This will install the linux shell on your Machine.

  • Update packages and mirrors using pacman -Syu.

  • You may have to restart

  • To install GCC copy the following code and paste in the shell Ctrl + v might not work

  • Note: Keep pressing ENTER to select the default installation instructions.

@linkdigitaluk
linkdigitaluk / wpgulp.config.js
Last active May 14, 2021 13:01
[WP Setup - wpgulp config file] For setting Up WPGulp, make sure yourProject URL matches a virual host set up in Wordpress or you'll have a bad time #wpGulp #NPM
/**
* WPGulp Configuration File
*
* 1. Edit the variables as per your project requirements.
* 2. In paths you can add <<glob or array of globs>>.
*
* @package WPGulp
*/
module.exports = {
@yinzara
yinzara / github_bitbucket_multiple_ssh_keys.md
Last active July 10, 2024 15:08
Managing SSH keys and repo cloning using multiple accounts on GitHub and BitBucket

Why Multiple SSH keys?

There are numerous reasons you may need to use multiple SSH keys for accessing GitHub and BitBucket

You may use the same computer for work and personal development and need to separate your work.

When acting as a consultant, it is common to have multiple GitHub and/or BitBucket accounts depending on which client you may be working for.

You may have different projects you're working on where you would like to segregate your access.

@PowellTravis
PowellTravis / API Data to MongoDB using Mongoose and Axios.md
Last active November 28, 2023 15:05
Using Mongoose and Axios Together to Upload API Data

BANNER

Using Mongoose and AXIOS to upload APU data to MongoDB

Uploading data using Axios and Mongoose can be hard at first. But when you really understand what you are doing you will be glad you are not reaching out to the API each time someone loads your webpage.

Installing the Packages

  1. Make sure you have nodejs and NPM installed, NPM comes with nodejs

npm install axios mongoose

@fnky
fnky / ANSI.md
Last active July 23, 2024 14:55
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27