Skip to content

Instantly share code, notes, and snippets.

Avatar

momoterraw andrewvmail

  • Vancouver
View GitHub Profile
@johnspurlock-skymethod
johnspurlock-skymethod / r2-notes.md
Last active November 11, 2022 06:08
Unofficial R2 notes
View r2-notes.md
@kyounger
kyounger / init.lua
Created July 25, 2020 04:45
hammerspoon draw box and obtain coordinates
View init.lua
hs.hotkey.bind(modShiftHyper, "W", function()
-- local tracking = false
local startingMousePosition = hs.mouse.getAbsolutePosition()
local max = hs.screen.mainScreen():fullFrame()
local maxCanvas = hs.canvas.new{x=max.x, y=max.y, h=max.h, w=max.w}
maxCanvas:clickActivating(false)
maxCanvas:canvasMouseEvents(true, true, false, true)
maxCanvas:mouseCallback(function(_, event, id, x, y)
local currentMousePosition = hs.mouse.getAbsolutePosition()
@David-Melo
David-Melo / overmind-graphql-effects.ts
Last active October 15, 2021 09:08
Overmind GraphQL Effects
View overmind-graphql-effects.ts
import { graphql } from 'overmind-graphql';
import { SubscriptionClient } from 'subscriptions-transport-ws';
// Query & Mutation GQL Tags
import * as queries from './queries';
import * as mutations from './mutations';
// Subscription GQL Tags
import { UsersUpdatedQuery } from './generated/api';
@GavinRay97
GavinRay97 / index.md
Last active June 26, 2022 07:14
Hasura organization permissions
View index.md

Introduction

This document outlines how to model a common organization-based permission system in Hasura. Let's assume that you have some table structure like the following:

Table Name Columns Foreign Keys
User id, name, email
Organization User id, user_id, organization_id user_id -> user.id, organization_id -> organization.id
Organization id, name
@andrewvmail
andrewvmail / perf-snippet.js
Created October 18, 2018 21:20
performance snippets
View perf-snippet.js
let toggle = false
const attachHandler = () =>
document
.getElementById("message-composer-input")
.addEventListener("change", function() {
if(!toggle) {
@alanstevens
alanstevens / Windows11_Setup.md
Last active January 11, 2023 09:07
Windows 11 Setup
View Windows11_Setup.md

This guide was created using Microsoft Windows 11 Pro

Version 21H2 build 22000.194

Installation

System Updates:

  • Settings -> Windows Update
  • Install all updates

Powershell Execution Policy:

  • launch Windows Powershell as administrator and execute:
@tombigel
tombigel / README.md
Last active March 6, 2023 06:54 — forked from a2ikm/limit.maxfiles.plist
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)
View README.md

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run:

@bigsnarfdude
bigsnarfdude / gist:d811e31ee17495f82f10db12651ae82d
Last active May 19, 2022 12:18
[boundingBox] opencv example python - Contours – bounding box, minimum area rectangle, and minimum enclosing circle
View gist:d811e31ee17495f82f10db12651ae82d
import cv2
import numpy as np
# read and scale down image
# wget https://bigsnarf.files.wordpress.com/2017/05/hammer.png #black and white
# wget https://i1.wp.com/images.hgmsites.net/hug/2011-volvo-s60_100323431_h.jpg
img = cv2.pyrDown(cv2.imread('2011-volvo-s60_100323431_h.jpg', cv2.IMREAD_UNCHANGED))
# threshold image
ret, threshed_img = cv2.threshold(cv2.cvtColor(img, cv2.COLOR_BGR2GRAY),
@justjanne
justjanne / Price Breakdown.md
Last active February 2, 2023 00:23 — forked from kylemanna/price.txt
Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:
View Price Breakdown.md

Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Permalink: git.io/vps

$5/mo

Provider Type RAM Cores Storage Transfer Network Price
@kbussell
kbussell / ctrlTap.lua
Last active February 13, 2021 17:46
Send escape key if the ctrl key is tapped. (Used along side remapping my Caps Lock key to ctrl) Thanks to @asmagill 's examples for a starting point.
View ctrlTap.lua
local alert = require("hs.alert")
local timer = require("hs.timer")
local eventtap = require("hs.eventtap")
local events = eventtap.event.types
local module = {}
-- timeout for ctrol key
module.timeFrame = .25