Skip to content

Instantly share code, notes, and snippets.

View vicasas's full-sized avatar
😎
Writing the future

Víctor Casas vicasas

😎
Writing the future
View GitHub Profile
@aschmoe
aschmoe / convertTypesToProps.mjs
Created August 25, 2023 22:42
Script example for typescript-to-proptypes
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import glob from 'glob';
import prettier from 'prettier';
import rimraf from 'rimraf';
import * as ttp from 'typescript-to-proptypes';
/**
* Creates needed directories for a file path
@sindresorhus
sindresorhus / esm-package.md
Last active June 20, 2025 00:13
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.
@ShaiYer
ShaiYer / RESTful-best-practice.md
Last active June 3, 2024 11:14
RESTful API - best practices

RESTful API best practices guide - by Shai Yerushalmi

Web API’s is a web development architecture which decoupling the client GUI from the database and the server’s logic. This architecture enables to serve the same interface to multiple clients running on various platforms. Also, the same application can communicate with multiple interfaces.

REST stands for Representational state transfer and its a stateless protocol over HTTP that provides the interactions with the resources stored in the database which contains four basic CRUD actions - Create, Read, Update and Delete.

Each CRUD interaction can be defined by combinations of the following:

@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active June 23, 2025 17:10
Conventional Commits Cheatsheet
@pablen
pablen / PubSub.js
Created January 13, 2018 21:16
React PubSub pattern
import React, { Component } from 'react';
import PubSub from 'pubsub-js';
class App extends Component {
state = { show: true };
render() {
return (
<div className="App">
<button onClick={() => this.setState(state => ({ show: !state.show }))}>
{this.state.show ? 'Hide panel' : 'Show panel'}
@thedaviddias
thedaviddias / .babelrc
Created February 13, 2017 12:24 — forked from dengjonathan/.babelrc
Webpack/ Babel/ Express Env for React
{
"plugins": ["react-hot-loader/babel"],
"ignore":[]
}