Skip to content

Instantly share code, notes, and snippets.

View iamwill123's full-sized avatar
💻
x.x

will.iam iamwill123

💻
x.x
View GitHub Profile
@iamwill123
iamwill123 / isReallyEmpty.test.js
Last active July 3, 2021 15:53
*WIP* isReallyEmpty - Ramda - enzyme / jest test
import { all, either, is, isEmpty, isNil, pipe, values,when } from 'ramda'
const isNilOrEmpty = either(isNil, isEmpty)
const areAllNilOrEmpty = pipe(
when(is(Object), values),
all(isNilOrEmpty),
)
describe('nilOrEmptyCheck util contains two utils, returns boolean (true or false)', () => {
@mikehwagz
mikehwagz / _app.js
Created August 22, 2020 13:14
Page transitions with GSAP in Next.js
import { SwitchTransition, Transition } from 'react-transition-group'
import gsap from 'gsap'
function MyApp({ Component, pageProps, router }) {
return (
<SwitchTransition>
<Transition
key={router.pathname}
timeout={500}
in={true}
@fnky
fnky / stripe-keys-and-ids.tsv
Last active July 17, 2024 22:12
Stripe keys and IDs
Prefix Description Notes
ac_ Platform Client ID Identifier for an auth code/client id.
acct_ Account ID Identifier for an Account object.
aliacc_ Alipay Account ID Identifier for an Alipay account.
ba_ Bank Account ID Identifier for a Bank Account object.
btok_ Bank Token ID Identifier for a Bank Token object.
card_ Card ID Identifier for a Card object.
cbtxn_ Customer Balance Transaction ID Identifier for a Customer Balance Transaction object.
ch_ Charge ID Identifier for a Charge object.
cn_ Credit Note ID Identifier for a Credit Note object.
@gaearon
gaearon / prepack-gentle-intro-1.md
Last active May 3, 2024 12:56
A Gentle Introduction to Prepack, Part 1

Note:

When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.

A Gentle Introduction to Prepack (Part 1)

If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:

  • Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
@adriennetacke
adriennetacke / countdown.js
Last active September 1, 2022 04:18
Countdown timer in pure JavaScript
function countdown(endDate) {
let days, hours, minutes, seconds;
endDate = new Date(endDate).getTime();
if (isNaN(endDate)) {
return;
}
setInterval(calculate, 1000);
@mpj
mpj / example01.js
Created August 14, 2017 07:38
Code for the async/await episode of Fun Fun Function.
const response = await fetch(`https://catappapi.herokuapp.com/users/${userId}`)
const data = await response.json()
return data.imageUrl
}
@ajaxray
ajaxray / firebase-online-user-count-example.md
Last active July 18, 2022 09:57
Keep list (and count) of online users in a Firebase web app - by isolated rooms or globally

Gathering.js - How to use

Keep list (and count) of online users in a Firebase web app - by isolated rooms or globally.

Live Demo

Firebase Shared Checklist is a demo application that shows the number of users joined a checklist using gathering.js. Here is a 1 minute screencast of using this application.

@dzt
dzt / node.md
Last active June 10, 2024 01:24
Node.js Reference/Cheatsheet

Node.js Cheat Sheet

Setting up Passport.js (REST API w/token auth) Example

  • app.js
  var express = require('express'),
    app = express(),
    port = process.env.PORT || 3000,
    mongoose = require('mongoose'),
var defaults = {
number: 1,
bool: true,
magic: 'real',
animal: 'whale',
croutons: 'delicious'
};
var options = {
number: 2,
@ryansechrest
ryansechrest / html-style-guide.md
Last active June 11, 2024 14:49
HTML style guide with coding standards and best practices.

HTML Style Guide

All rules and guidelines in this document apply to HTML files.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Icon Legend:

· Space, Tab, Enter/Return