Skip to content

Instantly share code, notes, and snippets.

@sindresorhus
sindresorhus / esm-package.md
Last active July 15, 2024 20:29
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.
anonymous
anonymous / filename.txt
Created January 14, 2018 06:24
This is an optional description
txt file content
anonymous
anonymous / config.json
Created July 13, 2017 19:39
Bootstrap Customizer Config
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@JonCatmull
JonCatmull / ordinal.pipe.ts
Last active January 12, 2024 16:09
Appends ordinal (st, nd ,rd ,th) to number or turns number into ordinal. Typescript Angular2 Pipe
import { Pipe, PipeTransform } from '@angular/core';
const ordinals: string[] = ['th','st','nd','rd'];
/*
* Append ordinal to number (e.g. "1st" position)
* Usage:
* value | ordinal:keepNumber
* Example:
* {{ 23 | ordinal}}
@inetbiz
inetbiz / schema-person.html
Last active December 2, 2021 23:55
Schema.org Person markup in JSON+LD format. Includes birthdate, place of birth, photo and worksFor with remote @id
<!-- Run the code inbetween <script></script> through https://www.webtoolkitonline.com/json-minifier.html -->
<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@type": "Person",
"@id": "#person",
"mainEntityOfPage": {
"@type": "ProfilePage",
"mainEntity": { "@id": "/schema-person.html#person" },
"lastReviewed": "2019-03-03T12:17:12.5249075-08:00"
@Otienoh
Otienoh / ubuntu-server-setup-16.04-LAMP.md
Last active January 4, 2022 04:53
LAMP Server setup for Ubuntu 16.04 on Digital Ocean

Server setup for Ubuntu 16.04 on Digital Ocean

The setup installs the following software:

The setup installs the following software:

  • Apache
  • MySQL
  • PHP
  • Node
@streetgt
streetgt / youtube_comment_bot.py
Last active January 15, 2022 13:04
Youtube Comment Bot - python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Python bot for comment a list of urls in YouTube
import time
import numpy as np
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
@Khodl
Khodl / hide-when-not-relevant.js
Last active January 2, 2017 08:26
Whatsapp share button
// Hide if not Android or iOS (and not iPod or iPad)
(function(){
var isIos = ((navigator.userAgent.match(/Android|iPhone/i) && !navigator.userAgent.match(/iPod|iPad/i)) ? true : false);
if(! isIos){
var v = document.getElementsByClassName('.share-whatsapp') ;
for(var j in v){
if(v[j].style)
v[j].style.display = 'none';
}
}