Skip to content

Instantly share code, notes, and snippets.

@nathanborror
nathanborror / gcloud-run.md
Last active May 31, 2022 15:50
How to setup a new Go project using Google Cloud Run and Cloud SQL.

Go Google Cloud

How to setup a new Go project using Google Cloud Run and Cloud SQL.

Setup a new project

Update gcloud and authenticate

$ gcloud components update
$ gcloud auth login
@aronskaya
aronskaya / catalyst_notes.md
Created September 3, 2019 16:51
Notes on Catalyst (macOS)

Toolbar

NSToolbar (Mac API) UIWindowScene.titlebar.toolbar — access

func scene(_ scene: UIScene,
			willConnectTo session: UISceneSession,
			options connectionOptions: 				UIScene.ConnectionOptions) {
		// setup the window
@kirkbyo
kirkbyo / .bash_profile
Last active August 31, 2021 22:51
Terminal Setup
# Output color
export CLICOLOR=1
export LSCOLORS=dxfxcxdxbxegedabagacad
# Prompt Color
PS1='\[\e[0;32m\]\u\[\e[m\] \[\e[1;34m\]\w\[\e[m\] \[\e[1;32m\]\$\[\e[m\] \[\e[1;37m\]'
alias atom="open -a atom.app"
alias grm='git checkout master && git pull origin master && git checkout - && git rebase master'
@ewenchou
ewenchou / README.md
Last active July 8, 2023 04:36
Run Python script as systemd service
  1. Create a service file like dash_sniffer.service
  2. Put it in /lib/systemd/system/
  3. Reload systemd using command: systemctl daemon-reload
  4. Enable auto start using command: systemctl enable dash_sniffer.service
@iammerrick
iammerrick / PinchZoomPan.js
Last active April 22, 2024 02:54
React Pinch + Zoom + Pan
import React from 'react';
const MIN_SCALE = 1;
const MAX_SCALE = 4;
const SETTLE_RANGE = 0.001;
const ADDITIONAL_LIMIT = 0.2;
const DOUBLE_TAP_THRESHOLD = 300;
const ANIMATION_SPEED = 0.04;
const RESET_ANIMATION_SPEED = 0.08;
const INITIAL_X = 0;
@ygotthilf
ygotthilf / jwtRS256.sh
Last active May 6, 2024 08:48
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@bendc
bendc / random-color.js
Last active February 7, 2024 03:19
Generate nice random colors
const randomColor = (() => {
"use strict";
const randomInt = (min, max) => {
return Math.floor(Math.random() * (max - min + 1)) + min;
};
return () => {
var h = randomInt(0, 360);
var s = randomInt(42, 98);
@ebuckley
ebuckley / gist:1842461
Created February 16, 2012 05:55
python code to encode/decode morse code
morseAlphabet ={
"A" : ".-",
"B" : "-...",
"C" : "-.-.",
"D" : "-..",
"E" : ".",
"F" : "..-.",
"G" : "--.",
"H" : "....",
"I" : "..",
@nimbupani
nimbupani / index.html
Created December 2, 2011 05:00
Showing latest post on home page with Jekyll
---
layout: default
---
<div class="blog-index">
{% assign post = site.posts.first %}
{% assign content = post.content %}
{% include post_detail.html %}
</div>