Skip to content

Instantly share code, notes, and snippets.

View josecarneiro's full-sized avatar

José Carneiro josecarneiro

View GitHub Profile
@KristofferEriksson
KristofferEriksson / useUndo.ts
Created January 31, 2024 11:34
A React hook that enhances your components with powerful undo/redo functionality
import { useCallback, useEffect, useRef, useState } from "react";
interface UseUndoHook<T> {
value: T;
onChange: (newValue: T) => void;
undo: () => void;
redo: () => void;
clear: () => void;
canUndo: boolean;
canRedo: boolean;
@diurivj
diurivj / MongoDB_Installation.md
Last active November 10, 2019 17:16
This is the MongoDB's recommended way to install MongoDB Enterprise Server.

MongoDB Installation

1. Download the files from MongoDB's page:

MongoDB recommends to use the most complete version of MongoDB Server, in order to do this, we will download MongoDB Enterprise. Download the package for your SO in TGZ format.

2. Extract the files:

$ tar -xvzf [name-of-the-file.tgz]
// Only export the things that are actually needed, cut out everything else
export { WebGLRenderer } from 'three/src/renderers/WebGLRenderer.js'
export { ShaderLib } from 'three/src/renderers/shaders/ShaderLib.js'
export { UniformsLib } from 'three/src/renderers/shaders/UniformsLib.js'
export { UniformsUtils } from 'three/src/renderers/shaders/UniformsUtils.js'
export { ShaderChunk } from 'three/src/renderers/shaders/ShaderChunk.js'
export { Scene } from 'three/src/scenes/Scene.js'
export { Mesh } from 'three/src/objects/Mesh.js'
export { LineSegments } from 'three/src/objects/LineSegments.js'
@tunguskha
tunguskha / Gradient shadow in pure CSS.md
Last active May 4, 2023 06:40
Gradient shadow in pure CSS

Gradient shadow in pure CSS

alt text

HTML
<button>Let's Go !</button>
anonymous
anonymous / index.pug
Created February 17, 2017 12:18
pRmJbw
main
header
h1 Michael Stevens
span
em Data de Nascimento:
| 5 de Junho de 1992
span
em Nacionalidade:
| Portuguesa
span
@shalkam
shalkam / mongoose-custom-type.js
Created February 12, 2017 19:59
creating a a custom mongoose schema type
'use strict';
var assert = require('assert');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
mongoose.connect('mongodb://localhost/db');
mongoose.set('debug', true);
class customType {