By resources
sessions
list-sessions ls -- List sessions managed by server
new-session new -- Create a new session
# undo last commit, keep changes | |
git reset --mixed HEAD~1 | |
# git log by directory | |
git log --oneline -n 10 -- dir_name/ | |
# ammend git commit message | |
git rebase -i parent-commit-hash | |
# replace pick with reword, then update the commit message. |
// go imports | |
go install golang.org/x/tools/cmd/goimports@latest | |
// enable ms | |
log.SetFlags(log.LstdFlags | log.Lmicroseconds) | |
// count number of tests | |
go test ./... -v | grep -c RUN |
# show number all tabs | |
:tabdo windo set number | |
# copy to clipboard fix | |
sudo apt-get install vim-gtk | |
# editorconfig | |
https://github.com/editorconfig/editorconfig-vim | |
# autocomplete |
· curl | |
curl -G "https://api.github.com/search/repositories?page=1&per_page=6" --data-urlencode "sort=stars" --data-urlencode "order=desc" --data-urlencode "q=language:html" | jq ".items[0,1,2,3,4,5] | {name, description, html_url}" | |
# set headers | |
curl localhost:8080 --header "jwt: mycooltoken" | |
# display headers | |
curl localhost:8080 -v | |
# show output in new line |
/* | |
2018/09/09 20:33:22 [GetCustomerBatchFn] batch size: 3 | |
2018/09/09 20:33:22 [GetCustomerAffiliationsBatchFn] batch size: 3 | |
2018/09/09 20:33:22 [GetGroupBatchFn] batch size: 4 | |
2018/09/09 20:33:22 [GraphQL result] total customers: 3 | |
2018/09/09 20:33:22 [GraphQL result]: | |
{"data":{"CustomerVisit":{"items":[{"customer":{"affiliations":{"items":[{"group":{"id":1,"name":"first group"}},{"group":{"id":4,"name":"fourth group"}}]},"first_name":"first customer","id":1,"last_name":"first customer last name"}},{"customer":{"affiliations":{"items":[{"group":{"id":2,"name":"second group"}},{"group":{"id":4,"name":"fourth group"}}]},"first_name":"second customer","id":2,"last_name":"second customer last name"}},{"customer":{"affiliations":{"items":[{"group":{"id":3,"name":"third group"}},{"group":{"id":4,"name":"fourth group"}}]},"first_name":"third customer","id":3,"last_name":"third customer last name"}}]}}} | |
*/ | |
package main |
package main | |
import ( | |
"fmt" | |
) | |
type Node struct { | |
Value int | |
} |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"log" | |
"github.com/graphql-go/graphql" | |
) |
/* | |
$ go run main.go | |
rootObject() | took: 1.000260951s | |
graphql.Do() | took: 367.401µs | |
graphql.Do() | result: {"data":{"me":{"github":{"issues":[{"id":"100"},{"id":"101"}],"pullRequests":[{"id":"200"},{"id":"201"}]}}}} | |
*/ | |
package main | |
import ( |
import React, { PureComponent } from 'react' | |
import Grid from 'material-ui/Grid' | |
import { CardNumberElement, CardExpiryElement, CardCVCElement } from 'react-stripe-elements' | |
import StripeElementWrapper from './StripeElementWrapper' | |
export default class extends PureComponent { | |
static displayName = 'StripeCardsSection' |