Skip to content

Instantly share code, notes, and snippets.


Jon Keam jkeam

View GitHub Profile
View odo-dotnet-demo.txt
# Get odo for linux
$ curl -OL && mv odo-linux-amd64 odo && chmod u+x odo
$ export PATH=$PATH:$(pwd)
$ odo version
# Use git to check out the .NET Core application
$ git clone
$ cd s2i-dotnetcore-ex/app
$ git checkout dotnetcore-3.1
dudash / kn-select
Last active Apr 13, 2021
Flip between versions of the Knative CLI easily
View kn-select
# Simple script to help configuring which kn CLI to use when you
# have a need to keep multiple versions and switch between them.
# Install and notes:
# 1. put this in /usr/local/bin and chmod +x
# 2. keep all the versions of kn in the /Applications directory
# 3. name kn executables with corresponding version - e.g. /Applications/kn-0.14.0
tonykhbo /
Last active Jun 19, 2020 — forked from tmckayus/
Running 'crc' on a remote server

Overview: running crc on a remote server

This original document shows how to deploy an OpenShift instance on a server using CodeReady Containers (crc) that can be accessed remotely from one or more client machines (sometimes called a "headless" instance). This provides a low-cost test and development platform that can be shared by developers. Deploying this way also allows a user to create an instance that uses more cpu and memory resources than may be available on his or her laptop.

While there are benefits to this type of deployment, please note that the primary use case for crc is to deploy a local OpenShift instance on a workstation or laptop and access it directly from the same machine. The headless setup is configured completely outside of crc itself, and supporting a headless setup is beyond the mission of the crc development team. Please do not ask for changes to crc to support this type of deployment, it will only cost the team time as they politely decline :)

The original gist by Roberto ha

kirillshevch /
Last active Nov 27, 2022
List of "rails new" options to generate a new Rails 7 application

Run rails new --help to see all of the options you can use to create a new Rails application:

Output for Rails 7+

  rails new APP_PATH [options]

      [--skip-namespace], [--no-skip-namespace]              # Skip namespace (affects only isolated engines)
npearce /
Last active Nov 25, 2022
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See:

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
pat / thinking_sphinx.yml
Last active Apr 23, 2022
Thinking Sphinx Configuration
View thinking_sphinx.yml
# Extended configuration for Thinking Sphinx can be stored in the
# config/thinking_sphinx.yml file within your application (this file was
# previously known as config/sphinx.yml in TS v1/v2).
# Many settings from Sphinx itself can be set here, and they'll flow through to
# the appropriate section of the generated configuration. However, some are
# used for Thinking Sphinx behaviour, and so those are documented here first.
# Configuration is grouped by environment, just like config/database.yml in a
# standard Rails application.
soulmachine /
Last active Nov 26, 2022
How to deal with JWT expiration?

First of all, please note that token expiration and revoking are two different things.

  1. Expiration only happens for web apps, not for native mobile apps, because native apps never expire.
  2. Revoking only happens when (1) uses click the logout button on the website or native Apps;(2) users reset their passwords; (3) users revoke their tokens explicitly in the administration panel.

1. How to hadle JWT expiration

A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.

Quoted from JWT RFC:

giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active May 16, 2022
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
View gist:ebaca117ac9e44231421f04e7796d5ca
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
chrishannah / iOS Icon
Last active Feb 15, 2022
A list containing all the icon names and sizes for iOS and watchOS.
View iOS Icon

iOS 12 Icon Sizes

(Taken from Xcode 10)


iPhone Notification (iOS 7-12) 20pt

  • 2x - 40px
  • 3x - 60px
caseywatts /
Last active Nov 16, 2022
Quicktime Hangouts Recording (using soundflower for audio)

Short link to this page:

Other gists & tricks:

Unrelated update: my book is out! Debugging Your Brain is an applied psychology / self-help book

Quicktime + Hangouts Recording

Scenario: You want to talk with someone over google hangouts (like for a user study), and you want to record BOTH: