Skip to content

Instantly share code, notes, and snippets.

View nathanfletcher's full-sized avatar

Nathan Fletcher nathanfletcher

View GitHub Profile
@nathanfletcher
nathanfletcher / database.js
Created July 20, 2020 14:32
Strapi database config file for Cloud Run
module.exports = ({ env }) => ({
defaultConnection: 'default',
connections: {
default: {
connector: 'bookshelf',
settings: {
client: 'mysql',
socketPath: "/cloudsql/gcloud-project-name:europe-west4:databasename",
database: process.env.DATABASE_NAME || '',
username: process.env.DATABASE_USERNAME || '',
@nathanfletcher
nathanfletcher / Dockerfile
Created May 9, 2020 10:07
Deploy PGAdmin 4 to Google Cloud Run
FROM dpage/pgadmin4
ENV [email protected]
ENV PGADMIN_DEFAULT_PASSWORD=somepassword
ENV PGADMIN_LISTEN_PORT=8080
steps:
- id: build
name: 'gcr.io/cloud-builders/npm'
entrypoint: 'bash'
args:
- '-c'
- |
pwd
npm install
@nathanfletcher
nathanfletcher / Google App Scripts Document template generator
Created May 9, 2019 12:44
This App scripts code take a list of details in a google sheet and replaces the details in a Google doc.
function onOpen() {
var menuEntries = [ {name: "Create Autofilled Template", functionName: "AutofillDocFromTemplate"}];
var ss = SpreadsheetApp.getActiveSpreadsheet();;
ss.addMenu("My Menu", menuEntries);
}
function AutofillDocFromTemplate(){
var templateid = "GOOGLE-DOCS-TEMPLATE-ID-GOES-HERE"; // this is the template file id. You can find this in the URL of the google document template. For example, if your URL Looks like this: https://docs.google.com/document/d/1SDTSW2JCItWMGkA8cDZGwZdAQa13sSpiYhiH-Kla6VA/edit, THEN the ID would be 1SDTSW2JCItWMKkA8cDZGwZdAQa13sSpiYhiH-Kla6VA
var FOLDER_NAME = "GOOGLE-DRIVE-FOLDER-NAME"; // Enter the name of the folder where you want to save your new documents. for example, this could be "Output Folder".
@nathanfletcher
nathanfletcher / .tmux.conf
Created February 1, 2017 11:09
my .tmux.config file. (nothing too fancy here). Borrowed most if it from Hermann Vocke : http://www.hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %
@nathanfletcher
nathanfletcher / FileChooser.java
Created August 9, 2016 20:40
This is a simple file chooser class for android
import android.app.Activity;
import android.app.Dialog;
import android.os.Environment;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager.LayoutParams;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
@nathanfletcher
nathanfletcher / notes.md
Created August 7, 2016 10:02
This explains how to setup Google App Engine Java on IntelliJ

#Google AppEngine Java

Here are the steps to follow when creating a project

  1. Start a new project
  2. Click "Java Enterprise"
  3. Scroll down the list and check "Google App Engine" and click next
  4. Give your project a name and finish the setup.
  5. When the project is done building, go to File > Project Structure > Artifacts
  6. Check "Build on make" and click OK