Skip to content

Instantly share code, notes, and snippets.

View janbaykara's full-sized avatar
🌗
Fighting the general election of everyday life

Jan Baykara janbaykara

🌗
Fighting the general election of everyday life
View GitHub Profile
@janbaykara
janbaykara / hyper-terminal-settings
Created May 28, 2018 17:03
Synced settings for Hyper terminal (https://hyper.is/) through `hyper-sync-settings` (https://www.npmjs.com/package/hyper-sync-settings)
{}
// function path<R>(obj: R) {
// function createKeyAccessor<O>(parent: O) {
// const accessor = <K extends keyof O>(key: K) => {
// const value = parent ? parent[key] : null
// return createKeyAccessor(value)
// }
// accessor.get = () => parent
// return accessor

Keybase proof

I hereby claim:

  • I am janbaykara on github.
  • I am janbaykara (https://keybase.io/janbaykara) on keybase.
  • I have a public key ASAEEjeLxsryXSDQ1n1bRHiAQOaXX3TttDrjk9_a1MJU4wo

To claim this, I am signing this object:

@janbaykara
janbaykara / example.ts
Last active June 8, 2020 15:03
Postcodes.io API batch consumer
(async () => {
const postcodeQueries = await bulk_postcode_geo(data.map(d => d.postcode).filter(Boolean))
})()
@janbaykara
janbaykara / env.ts
Created July 15, 2020 14:53
Typescript version of Strapi's env mini-library
'use strict';
import { EnvVars } from './types';
// Taken from https://github.com/strapi/strapi/blob/c90e3eb67bf2c235c2fdd1b5607eda6b649d9f10/packages/strapi/lib/core/app-configuration/env-helper.js
const _ = require('lodash');
type Translator<T = any> = (key: keyof EnvVars, defaultValue?: T) => T
const defaultEnv: Translator = (key, defaultValue) => {
@janbaykara
janbaykara / metomic.ts
Created July 15, 2020 16:13
A helper minilibrary for working with Metomic consent policies
export const ensureConsentFor = async (slug: string, askAgain = true) => {
const state = await getConsentState(slug)
if (state === true) return true
if (!askAgain) return false
return await requestConsentFor(slug)
}
enum State {
CONSENTED = 'CONSENTED',
DECLINED = 'DECLINED'
@janbaykara
janbaykara / .block
Created August 24, 2020 11:44 — forked from tomshanley/.block
Sankey in the style of 1960s river freight chart
license: mit
height: 800
border: yes
@janbaykara
janbaykara / .block
Last active August 24, 2020 14:36 — forked from tomshanley/.block
Sankey with circular link and animated dashes
license: mit
height: 800
@janbaykara
janbaykara / 1-table-contacts.png
Last active March 29, 2022 16:42
London Renters Union airtable setup. Airtable automation that will receive a webhook, create an event for it, and link it to an existing person in another table.
1-table-contacts.png
@janbaykara
janbaykara / README.md
Created October 11, 2022 00:16
Script to prepare Notion markdown pages for Logseq
  • Install github.com/andreoliwa/logseq-doctor
  • Load markdown files into a folder
  • Then run:
    mkdir node
    mkdir lsd
    node index
    cd node
    for f in ./*.md; do echo $f & lsd outline $f > ../lsd/$f; done