Skip to content

Instantly share code, notes, and snippets.

View gaving's full-sized avatar
🎯
Focusing

Gavin Gilmour gaving

🎯
Focusing
View GitHub Profile
# 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
name: "VGG_ILSVRC_16_layers"
layer {
name: "data"
type: "Data"
top: "data"
top: "label"
include {
phase: TRAIN
}
transform_param {
@gaving
gaving / direc
Last active November 5, 2017 09:34
192:~/Sandbox/dd% docker run -p 8080:8080 --name dd -v /Users/gavin/Sandbox/dd:/opt/models beniz/deepdetect_cpu
DeepDetect [ commit 978401f3d1f23a327d0ebfef24cb0a0d7c543c6e ]
INFO - 09:30:47 - Running DeepDetect HTTP server on 0.0.0.0:8080
INFO - 09:30:53 - Initializing net from parameters:
INFO - 09:30:53 - Creating layer / name=vgg_face / type=MemoryData
INFO - 09:30:53 - Creating Layer vgg_face
INFO - 09:30:53 - vgg_face -> data