Skip to content

Instantly share code, notes, and snippets.

View jtn-ms's full-sized avatar
🏘️
working from home

Brian G. jtn-ms

🏘️
working from home
  • remote
View GitHub Profile
@jtn-ms
jtn-ms / GA.indeed.html
Created November 1, 2022 20:11
google analytics
<script type="text/javascript">
(function() {
var ga_domains = [];
ga_domains.push("indeed.com");
ga_domains.push("indeed.com.au");
ga_domains.push("indeed.com.br");
import { Box } from "@mui/material";
import { styled } from "@mui/material/styles";
export const VBox = styled(Box)({
display: "flex",
flexDirection: "column"
});
export const HBox = styled(Box)({
display: "flex",
@jtn-ms
jtn-ms / Date Time, JSON Beautify.md
Last active October 16, 2022 21:51
cheatsheet for JavaScript
python javascript
json.dumps(ob,indent=2) JSON.stringify(ob,null,2)
@jtn-ms
jtn-ms / javascript vs. python.md
Last active November 7, 2022 13:01
javascript vs. python
  • Substr2Str - repeat
  • Str2Substr - substring
  • String2Array - split ,match
  • Array2String - join
  • Array2Object - lodash.countBy, lodash.groupBy
@jtn-ms
jtn-ms / axios.create.js
Created August 19, 2022 18:33
axios create - baseUrl, ...
import axios from "axios";
const storeApi = axios.create({
baseURL: 'https://fakestoreapi.com',
})
const res = await storeApi.get("/products");
@jtn-ms
jtn-ms / jsconfig.json
Last active September 2, 2022 14:40
jsconfig.json
{
"compilerOptions": {
"baseUrl": "src"
},
"include": ["src"]
}
@jtn-ms
jtn-ms / Emitter.js
Last active August 11, 2022 16:35 — forked from mayashavin/Emitter.js
Emitter Class Implementation
function Emitter(){
var events = new Map();
return {
subscribe: function(event_name, callback){
//If events has event_name, then get the event Subscription and push to it.
//Else create new event, subscription and add to events.
var isEventExisted = events.has(event_name), index = 0;
@jtn-ms
jtn-ms / AAA-README.md
Last active August 1, 2022 22:39
React - redux, store, action, history, theme - ignore history, it has no direct relation with store

Redux-thunk Actions & State

use - dispatch({type:"SetDark", payload:e.target.checked})

import { useDispatch, useSelector } from 'react-redux'
// use state for reference
const dark = useSelector(state => state.theme.dark);
// use action to change state
const dispatch = useDispatch();
dispatch({type:"SetDark", payload:e.target.checked})
@jtn-ms
jtn-ms / Gists.md
Created August 1, 2022 20:36 — forked from BoQsc/Gists.md
How to search my own Gists