Skip to content

Instantly share code, notes, and snippets.

View jquintozamora's full-sized avatar

José Quinto jquintozamora

View GitHub Profile
@RichieAHB
RichieAHB / Hooks.js
Last active October 26, 2018 15:09
import { hook, useState, useEffect } from 'react';
import { myMemoize } from './utils/my-memoize';
import CountsAPI from './services/count-api';
const Comp = (props, [counter, setCounter], [name, setName]) => <div />;
// hook(...stateful)(...effectful)
/*
* statefuls are functions that have access to props (and maybe the previous state?), reducers could be here too. What they return could be a variety of things but they allow react internals to pass the the value and updater to the following hooks and component

Strings

String.prototype.*

None of the string methods modify this – they always return fresh strings.

  • charAt(pos: number): string ES1

    Returns the character at index pos, as a string (JavaScript does not have a datatype for characters). str[i] is equivalent to str.charAt(i) and more concise (caveat: may not work on old engines).

@cvan
cvan / HOWTO.md
Last active September 15, 2024 06:14
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default

Instructions

CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.

  1. Make sure you have registered a domain name.
  2. Sign up for CloudFlare and create an account for your domain.
  3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
  4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
  5. If you
@leny
leny / .eslintrc.json
Last active August 3, 2024 16:44
ESLint config file for node.js + ES6 projects.
{
"env": {
"node": true,
"es6": true
},
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParameters": true,