Skip to content

Instantly share code, notes, and snippets.

View kevinmcalear's full-sized avatar

Kevin McAlear kevinmcalear

View GitHub Profile

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after

Excluded Inventions

Consultant shall have the right to retain ownership of any inventions, original works of authorship, discoveries, concepts or ideas, which are unrelated to Consultant’s present work (or the actual or demonstrably anticipated research or development of the Company) under this Agreement; or that the Consultant developed entirely on his own time without using the Company’s equipment, supplies, facilities and does not contain any Company trade secrets, proprietary materials or any other protected intellectual property owned by the Company. Consultant represents that the exclusion of such Inventions from this Section 9 (Inventions) will not materially affect Consultant’s ability

'''
flask-tweepy-oauth
an example showing how to authorize a twitter application
in python with flask and tweepy.
find the rest of the app here: https://github.com/whichlight/flask-tweepy-oauth
'''
@kevinmcalear
kevinmcalear / Application.js
Created March 10, 2017 21:26 — forked from koistya/App.js
How to add `onscroll` event in ReactJS component
'use strict';
var React = require('react');
var ExecutionEnvironment = require('react/lib/ExecutionEnvironment');
var Application = React.createClass({
componentDidMount() {
if (ExecutionEnvironment.canUseDOM) {
document.documentElement.addEventListener('scroll', this.handleScroll);
var npm = require("npm");
var fs = require("fs-extra");
var chokidar = require("chokidar");
var packagePaths = [
"../mobile-app/node_modules/shared-package/lib",
"../web-app/node_modules/shared-package/lib",
];
var noop = () => {};
Verifying my Blockstack ID is secured with the address 19i2ComWoeuEnCeVf45ax4Dx34UmawExS2 https://explorer.blockstack.org/address/19i2ComWoeuEnCeVf45ax4Dx34UmawExS2
@kevinmcalear
kevinmcalear / encryt_secrets_with_cloud_kms.sh
Created March 27, 2020 11:09 — forked from ljulliar/encryt_secrets_with_cloud_kms.sh
Encrypt secrets with Cloud KMS (Photo Album on Google Cloud Run)
# Create a key ring where to hook your encrypted keys
gcloud kms keyrings create photo-album --location=us-central1
# Encrypt the credentials of the cloud runner service account
gcloud kms keys create photo_album_runner_key --location us-central1 \
--keyring photo-album --purpose encryption
gcloud kms encrypt - location us-central1 --keyring photo-album \
--key photo_album_runner_key --plaintext-file ./config/photo_album_runner.key \
--ciphertext-file ./config/photo_album_runner.key.enc
@kevinmcalear
kevinmcalear / svc_account_roles.sh
Created March 27, 2020 11:09 — forked from ljulliar/svc_account_roles.sh
Setup service account roles (Photo Album on Google Cloud Run)
# Setup Photo Album service account
PA_SVC_ACCOUNT=photo-album-runner@$PROJECT_ID.iam.gserviceaccount.com
# Grant GCS admin role
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member serviceAccount:$PA_SVC_ACCOUNT --role roles/storage.admin
# Grant GCS admin role
gcloud projects add-iam-policy-binding $PROJECT_ID \
--member serviceAccount:$PA_SVC_ACCOUNT --role roles/cloudsql.client
@kevinmcalear
kevinmcalear / cloud_build_roles.sh
Created March 27, 2020 11:10 — forked from ljulliar/cloud_build_roles.sh
Cloud Build decrypt roles (Photo Album on Google Cloud Run)
# set an env variable to make things more readable
CB_SVC_ACCOUNT=xxx...xxx@cloudbuild.gserviceaccount.com
# Grant Cloud Build the right to decrypt Rails master key
$ gcloud kms keys add-iam-policy-binding rails_master_key --location=us-central1 \
--keyring=photo-album --member=serviceAccount:$CB_SVC_ACCOUNT \
--role=roles/cloudkms.cryptoKeyDecrypter
# Grant Cloud Build the right to decrypt Rails the production database password
$ gcloud kms keys add-iam-policy-binding db_pwd_key --location=us-central1 \