Skip to content

Instantly share code, notes, and snippets.

View lukesmurray's full-sized avatar
😎
Hard at work

Luke Murray lukesmurray

😎
Hard at work
View GitHub Profile
@lukesmurray
lukesmurray / copy_images_and_videos.sh
Created January 11, 2018 05:00
Copy all the images and videos from a file directory recursively to a single target folder
find . -type f -exec file -I {} + | rg 'video|image' | cut -d':' -f1 | xargs -I '{}' cp '{}' ~/Desktop/target_folder/
@lukesmurray
lukesmurray / .block
Created January 17, 2019 14:24
Vega-Lite Bl.ocks example
license: bsd-3-clause
@lukesmurray
lukesmurray / schools.json
Created August 8, 2019 22:36
School dcids
[
"geoId/sch510195000862",
"geoId/sch510195000861",
"geoId/sch510195000862",
"geoId/sch510195000861",
"geoId/sch510195000862",
"geoId/sch510195000861",
"geoId/sch510195000862",
"geoId/sch510195000861",
"geoId/sch510195000862",
@lukesmurray
lukesmurray / map.geojson
Last active August 19, 2019 19:25
Geojson coordinates of hawaii.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lukesmurray
lukesmurray / glocal
Created February 12, 2021 18:23
Git Local
glocal () {
echo "### Adding any wip files"
git add .
echo "### Committing files with a temporary commit"
git commit --no-verify -am 'local commit - work in progress'
echo "### Checking out branch"
git checkout "$1"
x="$(git log -1 --pretty=%B)"
if [ "$x" = "local commit - work in progress" ]
then
@lukesmurray
lukesmurray / setup.sh
Created February 18, 2021 02:32
Setup Conventional Commits
#!/bin/bash
# install commitizen, standard-version, husky, and commitilnt
yarn add -D commitizen standard-version husky @commitlint/{config-conventional,cli}
# initialize commitizen
./node_modules/.bin/commitizen init cz-conventional-changelog --yarn --save-dev --save-exact --force
# install husky
yarn husky install
# prepare commit msg with commitizen
yarn husky add .husky/prepare-commit-msg "exec < /dev/tty && git cz --hook || true"
@lukesmurray
lukesmurray / Research Paper Prompt.md
Last active August 7, 2021 22:15
Prompts for evaluating ideas before starting a research project

Prompts

Fill these out when you start a project. Copy the file every week or two and modify your answers as you learn more and your idea becomes clearer.

  • 💡 Key Idea: one clear sharp idea, a reusable insight, useful to the reader
  • What is the problem?
  • Why is the problem interesting?
  • Why isn't the problem solved?
  • What is our idea?
@lukesmurray
lukesmurray / vim-settings.json
Created September 29, 2021 14:49
vim settings for vscode
"vim.normalModeKeyBindingsNonRecursive": [
// use ctrl-hjkl to navigate splits instead of (ctrl+w + h)
{
"after": ["<C-w>", "h"],
"before": ["<C-h>"]
},
{
"after": ["<C-w>", "j"],
"before": ["<C-j>"]
},
import typing as t
import pydantic
import strawberry
class UserModel(pydantic.BaseModel):
age: int
password: t.Optional[str]
@lukesmurray
lukesmurray / example_usage.py
Last active October 8, 2021 21:25
strawberry_sqlalchemy updates
from __future__ import annotations
import typing as t
import strawberry
from sqlmodel import Field, Relationship, SQLModel
from .filter_generators import create_array_relationship_type, create_query_root