Skip to content

Instantly share code, notes, and snippets.

View rknell's full-sized avatar

Ryan Knell rknell

View GitHub Profile
@rknell
rknell / pre-commit
Created December 17, 2019 23:03
Flutter git precommit hook
#!/bin/sh
# To use add to `.git/hooks/`
# Should be named `pre-commit`
# Make executable with `chmod +x`
flutter analyze
flutter test
# Stash unstaged changes
git stash -q --keep-index
@rknell
rknell / Ubuntu Node Production Setup Script
Last active April 9, 2019 03:20
# What it does Sets up - Nginx, Node LTS, GIT, Creates an SSH key for GIT, Yarn, PM2, Certbot (LetsEncrypt), #
#!/bin/sh
# What it does
# Sets up - Nginx, Node LTS, GIT, Creates an SSH key for GIT, Yarn, PM2, PM2 Logrotate, Certbot (LetsEncrypt),
#
cd ~
sudo add-apt-repository ppa:certbot/certbot -y
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update -y
@rknell
rknell / build-release.sh
Last active November 7, 2023 08:23
Build Android Release apk from Cordova /CLI
#!/bin/bash
#Thanks to this page: http://chris-allen-lane.com/2012/12/phonegap-compiling-a-release-apk-without-using-phonegap-build/
#USAGE!
# 1. Replace <AndroidKeyName> with the filename of the keyfile generated (see url)
# 2. Replace <ProjectName> with the project name in the generated file form cordova, see path/to/my/project/platforms/android/bin and look for an APK if you need help
# 3. Replace <AndroidKeyNameAlias> from the alias used when generating the key (see url again!)
# 4. Edit path/to/my/project/platforms/android/AndroidManifest.xml and change "debuggable=false" (search for it!)
# 5. Check path/to/my/project/Release/android for your sparkling new apk!
#
# This worked and was uploadable to the google play store.