Skip to content

Instantly share code, notes, and snippets.

@eyesofkids
eyesofkids / functional-utils.js
Created August 26, 2016 02:03 — forked from bendc/functional-utils.js
A set of pure and immutable ES2015 functions aimed to make functional JavaScript more idiomatic.
// array utils
// =================================================================================================
const combine = (...arrays) => [].concat(...arrays);
const compact = arr => arr.filter(Boolean);
const contains = (() => Array.prototype.includes
? (arr, value) => arr.includes(value)
: (arr, value) => arr.some(el => el === value)
@eyesofkids
eyesofkids / gist:114e840b0811ed906f40f73e69cb82cf
Created September 7, 2016 03:48 — forked from AliMD/gist:3344523
All github Emoji (Smiles)

All github Emoji (Smiles)

ali.md/emoji

:bowtie: | 😄 | 😆 | 😊 | 😃 | ☺️ | 😏 | 😍 | 😘 | :kissing_face: | 😳 | 😌 | 😆 | 😁 | 😉 | :wink2: | 👅 | 😒 | 😅 | 😓

😩 | 😔 | 😞 | 😖 | 😨 | 😰 | 😣 | 😢 | 😭 | 😂 | 😲 | 😱 | :neckbeard: | 😫 | 😠 | 😡 | 😤 | 😪 | 😋 | 😷

😎 | 😵 | 👿 | 😈 | 😐 | 😶 | 😇 | 👽 | 💛 | 💙 | 💜 | ❤️ | 💚 | 💔 | 💓 | 💗 | 💕 | 💞 | 💘 | ✨

@eyesofkids
eyesofkids / .eslintrc
Created October 7, 2016 09:55 — forked from cletusw/.eslintrc
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
@eyesofkids
eyesofkids / notes.md
Created December 4, 2017 09:39 — forked from matthewjberger/notes.md
How to make an electron app using Create-React-App and Electron with Electron-Builder.
@eyesofkids
eyesofkids / index.md
Last active March 23, 2022 19:48 — forked from bvaughn/index.md
How to use profiling in production mode for react-dom

React recently introduced an experimental profiler API. This page gives instructions on how to use this API in a production release of your app.

Table of Contents

Profiling in production

React DOM automatically supports profiling in development mode for v16.5+, but since profiling adds some small additional overhead it is opt-in for production mode. This gist explains how to opt-in.

@eyesofkids
eyesofkids / FrontendFrameworksPopularity.md
Last active July 21, 2022 04:49 — forked from tkrotoff/FrontendFrameworksPopularity.md
Front-end frameworks popularity (React, Vue, Angular and Svelte)

Findings: React is by far the most popular front-end framework/library (and continues to grow faster). In addition, React is more loved and "wanted" than other front-end frameworks (although it is more used: satisfaction tends to decrease with popularity).

Charts are from different sources and thus colors are inconsistent, please carefully read the chart's legends.

Like this? Check React Native vs Flutter: https://gist.github.com/tkrotoff/93f5278a4e8df7e5f6928eff98684979

Stack Overflow trends

https://insights.stackoverflow.com/trends?tags=reactjs%2Cvue.js%2Cangular%2Csvelte%2Cangularjs

@eyesofkids
eyesofkids / Readme.md
Created July 21, 2022 09:49 — forked from ccarstens/Readme.md
Script for macOS to create daily, weekly and monthly mysqldumps and delete old ones

MySQL Backup for macOS

This shell script creates daily backups of all MySQL databases on macOS. Currently the script uses mysql@5.7, installed by homebrew.

  • Daily backups are kept for a week.
  • Weekly backups are kept for a month.
  • Monthly backups are kept for a year.

Setup

@eyesofkids
eyesofkids / 00-README-NEXT-SPA.md
Created March 23, 2023 16:24 — forked from gaearon/00-README-NEXT-SPA.md
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

@eyesofkids
eyesofkids / crud-service-interface
Created August 5, 2023 06:57 — forked from brandonchadlange/crud-service-interface
A simple interface for defining CRUD services
export interface ICrudService<T> {
getAll: () => Promise<T[]>;
getOne: (id: string) => Promise<T | null>;
create: (data: T) => Promise<T>;
update: (id: string, data: T) => Promise<T>;
delete: (id: string) => Promise<T>;
}
@eyesofkids
eyesofkids / crud-route-handlert.ts
Created August 5, 2023 06:57 — forked from brandonchadlange/crud-route-handlert.ts
A route handler that uses a CRUD service to quickly map and handle requests
import type { NextApiRequest, NextApiResponse } from "next";
type HttpMethod = "GET" | "POST" | "PUT" | "DELETE";
export const CrudRouteHandler = async <T>(
request: NextApiRequest,
response: NextApiResponse,
service: ICrudService<T>
) => {
const id = request.query.id as string;