Skip to content

Instantly share code, notes, and snippets.

View kenziebottoms's full-sized avatar

Kenzie Bottoms kenziebottoms

View GitHub Profile
import { useEffect } from "react";
const useOutsideClick = (ref, callback) => {
const handleClick = e => {
if (ref.current && !ref.current.contains(e.target)) {
callback();
}
};
useEffect(() => {
@kuanee
kuanee / example_form.jsx
Last active October 12, 2020 11:51
Using Joi Validation with redux-form
import createValidator from 'joi_redux_form.js';
import { reduxForm } from 'redux-form';
const schema = {
name: Joi.string().required(),
description: Joi.string().required(),
};
function ExampleForm(props) {
return (
@crizstian
crizstian / validate-joi-models.spec.js
Last active July 17, 2020 14:39
Example of testing joi validation
/* eslint-env mocha */
const test = require('assert')
const {validate} = require('./')
console.log(Object.getPrototypeOf(validate))
describe('Schemas Validation', () => {
it('can validate a booking object', (done) => {
const now = new Date()
now.setDate(now.getDate() + 1)
@CMCDragonkai
CMCDragonkai / job_control_zsh_bash.md
Last active August 1, 2024 00:35
CLI: Job Control in ZSH and Bash

Job Control in ZSH and Bash

All processes in ZSH/Bash under job control are in 3 states: foregrounded, backgrounded and suspended.

# run command in the foreground
command
# run commend in the background
@rxaviers
rxaviers / gist:7360908
Last active November 20, 2024 00:07
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@joyrexus
joyrexus / README.md
Last active November 5, 2024 14:17 — forked from liamcurry/gist:2597326
Vanilla JS equivalents of jQuery methods

Sans jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@willurd
willurd / web-servers.md
Last active November 19, 2024 22:45
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000