Skip to content

Instantly share code, notes, and snippets.

@rash3ye
rash3ye / pwa.ts
Created October 18, 2021 07:52 — forked from waelio/pwa.ts
Push Notifications
/* eslint-disable import/no-duplicates */
/* eslint-disable no-console */
const publicVapidKey = import.meta.env.VITE_VID_PUBLIC
const isClient = (): boolean => Boolean(typeof window !== 'undefined' && 'serviceWorker' in navigator)
const unSubscribe = async() => {
if (isClient) {
const reg = await navigator.serviceWorker.register('worker.js', { scope: '/' })
const subscription = await reg.pushManager.getSubscription()
@rash3ye
rash3ye / curl.md
Created October 8, 2021 23:19 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@rash3ye
rash3ye / remove-node-modules.md
Created February 4, 2021 14:51 — forked from lmcneel/remove-node-modules.md
How to remove node_modules after they have been added to a repo

How to remove node_modules

  1. Create a .gitignore file in the git repository if it does not contain one

touch .gitignore

  1. Open up the .gitignore and add the following line to the file

**/node_modules

@rash3ye
rash3ye / ISO3166-1.alpha2.json
Created January 13, 2021 16:28 — forked from ssskip/ISO3166-1.alpha2.json
json of country codes (ISO 3166-1 alpha-2) and corresponding names
{
"AF": "Afghanistan",
"AX": "Aland Islands",
"AL": "Albania",
"DZ": "Algeria",
"AS": "American Samoa",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Antarctica",
@rash3ye
rash3ye / element-classes-and-ids.scss
Created December 31, 2020 09:59 — forked from 5t3ph/element-classes-and-ids-vanilla.css
Tag HTML elements with their class names and IDs to visualize page structure
*[class],
*[id] {
position: relative;
outline: 2px dashed red;
&::before,
&::after {
position: absolute;
top: 0;
left: 0;
@rash3ye
rash3ye / stimulus.md
Created November 18, 2020 13:28 — forked from mrmartineau/stimulus.md
Stimulus cheatsheet