Skip to content

Instantly share code, notes, and snippets.

View project42da's full-sized avatar
🏠
Working from home

Tart Chun project42da

🏠
Working from home
  • Seoul, South Korea
View GitHub Profile
@gragland
gragland / use-auth.jsx
Last active August 27, 2022 15:16
React Hook recipe from https://usehooks.com
// Top level App component
import React from "react";
import { ProvideAuth } from "./use-auth.js";
function App(props) {
return (
<ProvideAuth>
{/*
Route components here, depending on how your app is structured.
If using Next.js this would be /pages/_app.js
@bradtraversy
bradtraversy / mongodb_cheat_sheet.md
Last active April 11, 2024 09:54
MongoDB Cheat Sheet

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database

@timc1
timc1 / use-auth.js
Created June 10, 2019 00:20
React Context + Hooks + Firebase Authentication
import React from 'react'
import firebaseConfig from '../path/to/firebase-config'
import firebase from 'firebase/app'
import 'firebase/auth'
import FullPageLoading from '../path/to/full-page-loading'
AuthProvider.actions = {
setUser: 'SET_USER',
toggleLoading: 'TOGGLE_LOADING',
}
@selbekk
selbekk / server.js
Created August 18, 2017 12:39
Super simple server side rendering with React and styled-components
const express = require('express');
require('babel-register')({
ignore: /\/(build|node_modules|.svg)\//,
presets: ['env', 'react-app']
});
const universal = require('./universal');
const app = express();
@nrollr
nrollr / MongoDB_macOS_Sierra.md
Last active April 1, 2024 16:23
Install MongoDB on Sierra using Homebrew

Install MongoDB on macOS Sierra

This procedure explains how to install MongoDB using Homebrew on macOS Sierra 10.12.
Official MongoDB install documentation: here

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@busypeoples
busypeoples / TestSetupExampleCRAEnzymeChaiMocka.md
Last active May 13, 2019 13:07
Mocha/Chai/Enyzme test setup with create-react-app

Basic setup for using Enzyme/Mocha/Chai with create-react-app

This is a temporary solution. Might change in the near future, this depends on how create-react-app will implement testing.

create-react-app quick-test-example

cd quick-test-example

npm run eject
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 15, 2024 23:29
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@brianmacarthur
brianmacarthur / flash-app.js
Last active July 10, 2023 18:41
Flash messaging in Express 4: express-flash vs. custom middleware in ejs, handlebars, or jade
var express = require('express');
var cookieParser = require('cookie-parser');
var session = require('express-session');
var flash = require('express-flash');
var handlebars = require('express-handlebars')
var app = express();
var sessionStore = new session.MemoryStore;
// View Engines
@rxaviers
rxaviers / gist:7360908
Last active April 16, 2024 06:18
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:
@jareware
jareware / SCSS.md
Last active February 13, 2024 14:33
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso