Skip to content

Instantly share code, notes, and snippets.

View heggy231's full-sized avatar
🎯
Focusing

Heggy Here heggy231

🎯
Focusing
  • San Francisco, Bay Area
View GitHub Profile

FLAG: On self-managed GitLab, by default this feature is not available. To make it available, ask an administrator to enable the files_api_throttling flag.
On GitLab.com, this feature is available but can be configured by GitLab.com administrators only. The feature is not ready for production use.

@heggy231
heggy231 / install.sh
Created August 23, 2021 01:53 — forked from coryhouse/install.sh
Dependencies for React Auth0 on Pluralsight - Last Updated 7/15/2020
npm install auth0-js@9.13.4 auth0-lock@11.25.1 express@4.17.1 express-jwt@5.3.1 express-jwt-authz@1.0.0 jwks-rsa@1.3.0 npm-run-all@4.1.5 react-router-dom@5.2.0
var OAuth = require('oauth')
// `npm install oauth` to satisfy
// website: https://github.com/ciaranj/node-oauth
var KEY = "<INSERT KEY HERE>"
var SECRET = "<INSERT SECRET HERE>"
var oauth = new OAuth.OAuth(
'http://api.thenounproject.com',
'http://api.thenounproject.com',
@heggy231
heggy231 / MIT-LICENSE.txt
Created July 23, 2021 00:27
MIT-LICENSE
Copyright (c) 2012-2021 Heggy Castaneda
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@heggy231
heggy231 / react-hook-text-toggle.jsx
Last active July 13, 2021 13:46
check box toggles what text displays on screen react hook useState simple ex
import React, { useState } from "react";
import ReactDOM from "react-dom";
import "./index.css";
const Checkbox = () => {
const [checked, setChecked] = useState(false);
return (
<>
@heggy231
heggy231 / githHubUsers-30.js
Last active July 12, 2021 09:17
git hub users 30 fetch data
// inside of index.js
import React, { useState, useEffect } from "react";
import ReactDOM from "react-dom";
function GitHubUsers() {
// fetching data from https://api.github.com/users
const [data, setData] = useState(null);
useEffect(() => {
// fetching github users data
@heggy231
heggy231 / fetch-api-examples.md
Created July 12, 2021 04:43 — forked from justsml/fetch-api-examples.md
JavaScript Fetch API Examples
@heggy231
heggy231 / side-effect-react.js
Created July 12, 2021 02:31
why side effect is bad and how useEffect() decouples it
import React, { useState, useEffect } from "react";
import ReactDOM from "react-dom";
import "./index.css";
function Greet({ name }) {
const message = `Hello, ${name}!`; // calc Output
// BAD!
// alert(document.title); // => react app
// document.title = 'KDrama'; // => side-effect!
// alert(`after change title: ${document.title}`) // => KDrama then the component finally shows "Hello, Heggy!"
@heggy231
heggy231 / array-destructuring-react.js
Created July 11, 2021 10:57
array destructuring used in react
var food = [
'candy',
'veggie',
'rice'
];
food[0] // candy
food[1] // veggie
food[2] // rice
@heggy231
heggy231 / ternary-react.jsx
Created July 11, 2021 10:11
ternary react conditional
import React from "react";
import ReactDOM from "react-dom";
import "./index.css";
function Lake({ name }) {
return (
<div>
<h1>πŸŠβ€β™€οΈπŸ–πŸ Visit {name}!</h1>
</div>
);