Skip to content

Instantly share code, notes, and snippets.

View PedramNavid's full-sized avatar
😼
i am not a cat

Pedram Navid PedramNavid

😼
i am not a cat
View GitHub Profile
This uses llm.datasette.io and OpenAI.
I use `git commit --template` to provide the output from the LLM to Git. This way, if you do not like the results, you
can quit your editor and no commit will be made.
# Shell function for generating a diff and editing it in your default editor:
gcllm() {
GIT_DIR="$(git rev-parse --git-dir)"
TEMPLATE="$GIT_DIR/COMMIT_EDITMSG_TEMPLATE"
@PedramNavid
PedramNavid / gatsby-ssr.js
Last active August 7, 2022 01:51
Gatsby SSR with Jitsu
// https://www.gatsbyjs.com/docs/reference/config-files/gatsby-ssr/
import React from "react";
export function onRenderBody({ setHeadComponents }, pluginOptions) {
const host = 'https://t.jitsu.com/s/lib.js'
const key = process.env.GATSBY_JITSU_API_KEY
const snippet = `window.jitsu = window.jitsu || (function(){(window.jitsuQ = window.jitsuQ || []).push(arguments);})`
// only render snippet if write key exists
if (key) {
@PedramNavid
PedramNavid / gist:d35876f1c4a1f393f08977e430ed7ed3
Created September 5, 2021 00:34
Neovim settings for js/python
──────┬─────────────────────────────────────────────────────────────────────────────────────────────────
│ File: ftplugin/json.vim
───────┼─────────────────────────────────────────────────────────────────────────────────────────────────
1 │ set shiftwidth=2 " number of spaces to use for each indent
2 │ set tabstop=2 " tabs appear as 4 spaces
3 │ set softtabstop=2 " pressing tab inserts 4 spaces
4 │ set expandtab " pressing tab uses spaces instead of tabs
5 │ set smartindent " auto-indent on new lines
6 │
7 │ set colorcolumn=80
@PedramNavid
PedramNavid / entrypoint.sh
Created February 6, 2019 19:52
Add airflow connections to GCP via Commandline
for conn in bigquery_default google_cloud_default; do
airflow connections -d --conn_id $conn;
airflow connections -a \
--conn_id $conn \
--conn_type google_cloud_platform \
--conn_extra '{ "extra__google_cloud_platform__key_path":"'`
`'token.json", '`
`'"extra__google_cloud_platform__project":'`
`'"my-project-id", '`
`'"extra__google_cloud_platform__scope":'`