I hereby claim:
- I am jmhungdev on github.
- I am jmhungdev (https://keybase.io/jmhungdev) on keybase.
- I have a public key ASBz_GPO_eFtk9_WA93WQuAFhjef8iCtF0EUCCkDpI_JwQo
To claim this, I am signing this object:
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Example", | |
"type": "node", | |
"request": "launch", | |
"runtimeExecutable": "node", | |
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"], |
#!/bin/bash | |
OLD_MODULE_NAME=jmhungdev/go-example | |
NEW_MODULE_NAME=jmhundev/go-lessons | |
# replace module name in go.mod | |
go mod edit -module $NEW_MODULE_NAME | |
# find all .go files in current dir and sub dirs | |
# for each file replace old module name with the new one in place |
// stackoverflow post: | |
// https://stackoverflow.com/questions/75739563/converting-struct-to-csv-string/75740486#75740486 | |
// [][]string or []Struct{} are preferred types to represent table data (csv) because of golang package ecosystem | |
// The case below is a special Data struct type that doesn't fit either | |
// which requires an additional step to transform it into [][]string before "encoding/csv" package can transform it into csv | |
package main | |
import ( |
// Heading H1 - H6 | |
# H1 | |
## H2 | |
### H3 | |
###### H6 | |
// Use blank line to create a new paragraph | |
// Bold text | |
**here bold text** |
// load html reponse in cheerio and retrieve the text of first h2 tag | |
const $ = cheerio.load(pm.response.text()); | |
let latestDate = $("h2").first().text() | |
const requrl = `https://postman-echo.com/get?date=${latestDate}` | |
// send async request with callback | |
pm.sendRequest(requrl, function (err, response) { | |
console.log(response.json()); | |
}); |
I hereby claim:
To claim this, I am signing this object:
// Use case: when dealing with deeply nested objects. | |
// example: { dog : { cat : { parrot : peacock }}} | |
let obj = { dog : { cat : { parrot : 'peacock' }}}; | |
let iWantPeacock = obj.dog.cat.parrot; //can throw an error | |
// Alternatively, one can do preliminary checks before the assignment |
import React from 'react'; | |
//alternatively you can write: import { Component } from 'react' | |
//and define your class this way: class App extends Component | |
class App extends React.Component { | |
//initiate your class component with a constructor | |
constructor(props) { | |
//inherit the props from React.Component class by using super() |
function add(x,y){ | |
return x+y; | |
} |