Skip to content

Instantly share code, notes, and snippets.

View gaving's full-sized avatar
🎯
Focusing

Gavin Gilmour gaving

🎯
Focusing
View GitHub Profile
@gaving
gaving / leaderboard.sh
Created February 23, 2020 19:55
duolingo leaderboard
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 \
@gaving
gaving / Dockerfile
Last active December 17, 2019 14:19
FROM golang:1.13
WORKDIR /go/src/app
COPY . .
RUN make install
RUN ls
CMD ["/go/src/app/lab"]
# 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() {
@gaving
gaving / ok.js
Created April 23, 2019 13:50
ok
[ { date_of_birth: { order: 'asc' } } ]
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Convenience utility functions for NiPyApi, not really intended for external use
"""
from __future__ import absolute_import, unicode_literals
import logging
import json
import json
import sys
import traceback
import csv
from java.nio.charset import StandardCharsets
from org.apache.commons.io import IOUtils
from org.apache.nifi.processor.io import StreamCallback
from org.python.core.util import StringUtil
class PyStreamCallback(StreamCallback):
@gaving
gaving / madewithreactnative.md
Last active June 27, 2020 20:30
madewithreactnative.md

Could you introduce your app in a few sentences? What does it do, who is it for? Which platforms? Personal app or for company?

Lexi is an open source iOS app for displaying and dictating a random Greek Word of the Day, with history and favourite features.

It was developed as a learning project (primarily) and for my parents who would find a random word of the day interesting in their efforts to learn the

@gaving
gaving / speak.js
Last active January 27, 2018 15:29
expo Speech SDK
_speak = (language, text) => {
const { pitch, rate } = this.state;
const start = () => {
this.setState({ inProgress: true });
};
const complete = () => {
this.state.inProgress && this.setState({ inProgress: false });
};
@gaving
gaving / call.sh
Last active December 1, 2017 09:01
curl 'http://demo.searchkit.co/api/crimes/_search' -H 'Pragma: no-cache' -H 'Origin: http://localhost:3000' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.9' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36' -H 'Content-Type: application/json;charset=UTF-8' -H 'Accept: application/json, text/plain, */*' -H 'Cache-Control: no-cache' -H 'Referer: http://localhost:3000/?q=theft' -H 'Connection: keep-alive' --data-binary \@request.json --compressed
# Insert your preferred key mappings here.
map h goBack
map l goForward