Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Gavin Gilmour gaving

🎯
Focusing
View GitHub Profile
View gist:35ed7177c38fbfa93bd06f25ea0c1ef9
mdl . | ( grep -v "Kramdown Warning: No link definition for link ID '\[\?_toc_\]\?' found on line" || true )
@gaving
gaving / README.md
Last active Jan 19, 2021
import-icons-by-path
View README.md

Description

Convert Material UI icons to path imports. E.g.

-import { ErrorOutline as ErrorIcon } from "@material-ui/icons";
+import ErrorIcon from "@material-ui/icons/ErrorOutline";

Reasoning:-

@gaving
gaving / README.md
Last active Jan 19, 2021
convert-to-absolute-imports
View README.md

Description

Convert Material UI icons to path imports. E.g.

-import DashboardTitle from "../../../components/Dashboard/DashboardTitle";
+import DashboardTitle from "components/Dashboard/DashboardTitle";

Reasoning:-

View index.html
<div class="tos-wrapper">
<h1 class="title">TOS</h1>
<div id="count"></div>
<div id="tos"></div>
</div>
View keybase.md

Keybase proof

I hereby claim:

  • I am gaving on github.
  • I am gaving (https://keybase.io/gaving) on keybase.
  • I have a public key ASAus1flHDIEFaLySFtJhm8D-LbShQcRlNkmqf87GlgKHQo

To claim this, I am signing this object:

@gaving
gaving / merge_flow.sh
Last active Feb 23, 2020
merge_flow.sh
View merge_flow.sh
#merge <commit/merge message>
#to be run in a dirty working tree on a feature branch
merge() {
g # status
# gcb $1
gca --signoff -m $1 # commit
gpsup # push branch and track remote
MR=$(lab mr create -d -a gaving -m $1 | tr -d -c 0-9) # create merge and store number
lab mr list # list
lab mr show $MR # show
@gaving
gaving / leaderboard.sh
Created Feb 23, 2020
duolingo leaderboard
View leaderboard.sh
leaderboard() {
http --session=duo \
GET 'https://duolingo-leaderboards-prod.duolingo.com/leaderboards/7d9f5dd1-8423-491a-91f2-2532052038ce/users/432412033?client_unlocked=true&_=1582470157128' \
| jq -r '.active.cohort.rankings[] | [.score, .display_name] | join (" ")' \
| tac \
| gsed 's/gaving/gaving 👈/g' \
| paste - \
| column \
| expand \
| bat \
View Dockerfile
FROM golang:1.13
WORKDIR /go/src/app
COPY . .
RUN make install
RUN ls
CMD ["/go/src/app/lab"]
View aliases.zsh
# find a file by filename
# fz .json fx
# fz .json "jq -C '.' | less -R"
fz() {
f $1 | fzf --bind "enter:execute(${2:-bat} {})" --preview "bat --color=always {}"
}
# find a file by content
# az ingest open
az() {
View ok.js
[ { date_of_birth: { order: 'asc' } } ]