Skip to content

Instantly share code, notes, and snippets.

View jkeam's full-sized avatar
🍻

Jon Keam jkeam

🍻
View GitHub Profile
@kawaz
kawaz / install_neovim_to_amazonlinux.sh
Last active April 6, 2024 13:57
install neovim to amazonlinux
#!/usr/bin/env bash
sudo yum groups install -y Development\ tools
sudo yum install -y cmake
sudo yum install -y python34-{devel,pip}
sudo pip-3.4 install neovim --upgrade
(
cd "$(mktemp -d)"
git clone https://github.com/neovim/neovim.git
cd neovim
make CMAKE_BUILD_TYPE=Release
@sebboh
sebboh / gist:f1dfe4f096746c45f3e9ea06a09743a0
Last active February 27, 2024 17:10 — forked from masonforest/gist:4048732
Installing a Gem on Heroku from a Private GitHub Repo

Installing a Gem on Heroku from a Private GitHub Repo

Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.

Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.

This method does not add your OAuth token to Gemfile.lock. It uses bundle config to store your credentials, and allows you to configure Heroku to use environment variables when deploying.

  1. Generate an OAuth token from GitHub
task explodedWar(type: Copy) {
into "$buildDir/exploded"
with war
}
war.dependsOn explodedWar
#!/usr/bin/env bash
# Original Source: http://blog.nonuby.com/blog/2012/07/05/copying-env-vars-from-one-heroku-app-to-another/
## Usage: heroku_env_copy [options] SOURCE TARGET
##
## NOTE: This script will only output the command, you should run it yourself.
##
## Options:
## -h, --help Display this message.
##
@flemdizzle
flemdizzle / evaluation.js.jsx
Created February 5, 2017 16:56
Some JSX code to send to Jon
var Evaluation = React.createClass({
getInitialState: function() {
return {evaluation: this.props.evaluation};
},
updateData: function(form, data) {
var index = this.state.evaluation.indexOf(form);
var form_data = React.addons.update(this.state.evaluation[index].form,
{ $merge: data });
form.form = form_data;
@caseywatts
caseywatts / quicktime-hangouts-recording.md
Last active February 14, 2024 02:18
Quicktime Hangouts Recording (using soundflower for audio)

Short link to this page: caseywatts.com/quicktime

Other gists & tricks: http://caseywatts.com/gists-and-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:

@chrishannah
chrishannah / iOS Icon Sizes.md
Last active February 15, 2022 23:43
A list containing all the icon names and sizes for iOS and watchOS.

iOS 12 Icon Sizes

(Taken from Xcode 10)

iPhone

iPhone Notification (iOS 7-12) 20pt

  • 2x - 40px
  • 3x - 60px
@tuxfight3r
tuxfight3r / curl_notes.txt
Last active February 16, 2023 12:44
openshift rest api login / json patch via curl
#Login to openshift and retrieve token
curl -u admin -kv -H "X-CSRF-Token: xxx" \
'https://master.cluster.local:8443/oauth/authorize?client_id=openshift-challenging-client&response_type=token'
#It should give you a bearer token like this
https://master.cluster.local:8443/oauth/token/implicit#access_token=aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4&expires_in=86400&scope=user%3Afull&token_type=Bearer
TOKEN="aRVmsEHbUEhd4WeP2bctj0n57ogHMBvOIcrtjc7tCw4"
#Get a configmap named configmaptest
@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active March 1, 2024 14:39
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
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
@soulmachine
soulmachine / jwt-expiration.md
Last active April 9, 2024 04:12
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: