python | javascript |
---|---|
json.dumps(ob,indent=2) |
JSON.stringify(ob,null,2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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"); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |
- Substr2Str -
repeat
- Str2Substr -
substring
- String2Array -
split
,match
- Array2String -
join
- Array2Object -
lodash.countBy
,lodash.groupBy
k | v |
---|---|
user | https://randomuser.me/api |
users | https://jsonplaceholder.typicode.com/users |
products | https://fakestoreapi.com/products |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from "axios"; | |
const storeApi = axios.create({ | |
baseURL: 'https://fakestoreapi.com', | |
}) | |
const res = await storeApi.get("/products"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"baseUrl": "src" | |
}, | |
"include": ["src"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
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})
Type this into Github Gist Search (https://gist.github.com/)
user:BoQsc your search query
NewerOlder