Skip to content

Instantly share code, notes, and snippets.

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

Jude Agboola marvinjude

🏠
Working from home
View GitHub Profile
@marvinjude
marvinjude / backup.shell
Created July 30, 2020 12:54
command to backup mysql db
/usr/bin/mysqldump -u dbusername -p'dbpassword' dbname > ${HOME}/path/backup.sql
@marvinjude
marvinjude / fetch.md
Last active July 14, 2020 14:38
fetch a new remote branch to your local repository

fetch a new remote branch to your local repository

git fetch origin <source-branch>:<new-local-branch>
git checkout <new-local-branch>
@marvinjude
marvinjude / sample.html
Created May 14, 2020 20:32
Showing user's google avatar in image tag
<img
src={"url"}
alt=""
referrer-policy="no-referrer"
/>
@marvinjude
marvinjude / cloudSettings
Last active May 9, 2020 22:26
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-05-09T22:26:09.895Z","extensionVersion":"v3.4.3"}
/**
* Modern browsers can download files that aren't from same origin this is a workaround to download a remote file
* @param `url` Remote URL for the file to be downloaded
*/
function Download({ url, filename }) {
const [fetching, setFetching] = useState(false);
const [error, setError] = useState(false);
const download = (url, name) => {
if (!url) {
@marvinjude
marvinjude / download.js
Created October 8, 2019 14:15
Download file
/**
* Modern browsers can download files that aren't from same origin this is a workaround to download a remote file
* @param `url` Remote URL for the file to be downloaded
*/
function Download({ url, filename }) {
const [creatingURI, setCreatingURI] = useState(false);
const download = () => {
setCreatingURI(true);
function Example(){
//Scenerio A
let[name, setUser] = useState('')
let[age, setAge] = useState('')
let[school, setSchool] = useState('')
let[height, setHeight] = useState('')
//Scenerio B
@marvinjude
marvinjude / reducer.js
Last active March 30, 2019 18:02
Reducer & Component
function bioReducer(state, action) {
switch (action.type) {
case "SET_NAME":
return Object.assign({}, state, { name: action.payload.name });
case "SET_AGE":
return Object.assign({}, state, { age: action.payload.age });
default:
throw new Error(
"Your Action Must Have A Type! Consider calling dispatch with an Action"
);
@marvinjude
marvinjude / bio.js
Last active March 30, 2019 17:58
bio
function Bio(){
let[name, SetName] = useState("Mary Gbebodyee");
let[age, SetAge] = useState(29);
function setNameHandler(){
setName("Mary Zlatan")
}
return(
<div>
<h1>{name}</h1>
<h1>{age}</h1>
Symbol.iterator in [] // true
Symbol.iterator in {} // false
Symbol.iterator in "" // true
//....