Skip to content

Instantly share code, notes, and snippets.

View thinnker's full-sized avatar

Jason Roberts thinnker

  • Cape Town, South Africa
View GitHub Profile
@thinnker
thinnker / deploy.sh
Created May 24, 2020 17:30 — forked from BenSampo/deploy.sh
Laravel deploy script
# Change to the project directory
cd /home/forge/domain.com
# Turn on maintenance mode
php artisan down
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
git pull origin master
@thinnker
thinnker / index.html
Created January 6, 2020 06:53 — forked from nk-gears/index.html
Add React in One Minute
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Add React in One Minute</title>
</head>
<body>
<h2>Add React in One Minute</h2>
<p>This page demonstrates using React with no build tooling.</p>
@thinnker
thinnker / 00-hello-world.html
Created January 6, 2020 06:53 — forked from nk-gears/00-hello-world.html
CS371 React Samples with Dropin Scripts
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Hello React</title>
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script>
@thinnker
thinnker / do_cloud-config.init.yaml
Created December 31, 2019 12:26 — forked from c0psrul3/do_cloud-config.init.yaml
Digital Ocean cloud-init / cloud-config / droplet metadata usage
#
#DO droplet metadata intro + for DO-API
# [https://www.digitalocean.com/community/tutorials/an-introduction-to-droplet-metadata#how-to-retrieve-droplet-metadata#digitalocean-api]
#
#intro to cloud-config scripting (source of following examples)
# [https://www.digitalocean.com/community/tutorials/an-introduction-to-cloud-config-scripting]
#
#howto
# [https://www.digitalocean.com/community/tutorials/how-to-use-cloud-config-for-your-initial-server-setup]
#
$ doctl compute size list
Slug Memory VCPUs Disk Price Monthly Price Hourly
512mb 512 1 20 5.00 0.007440
s-1vcpu-1gb 1024 1 25 5.00 0.007440
1gb 1024 1 30 10.00 0.014880
s-1vcpu-2gb 2048 1 50 10.00 0.014880
s-1vcpu-3gb 3072 1 60 15.00 0.022320
s-2vcpu-2gb 2048 2 60 15.00 0.022320
s-3vcpu-1gb 1024 3 60 15.00 0.022320
2gb 2048 2 40 20.00 0.029760
@thinnker
thinnker / script.js
Created December 24, 2019 08:29 — forked from rayfarer/script.js
Add Timestamp When Document Created Firestore
/*
Using Cloud Functions, here's what I've come up with for anyone who wants to
add a timestamp field in a Firestore document. You need to have the Firebase Admin SDK installed in
addition to the general setup for Cloud Functions as detailed in the Firebase documentation.
*/
const functions = require('firebase-functions');
// The Firebase Admin SDK to access the Firebase Realtime Database.
const admin = require('firebase-admin');
@thinnker
thinnker / laravel
Created December 8, 2019 17:32 — forked from marianmirzacu/laravel
nginx config file for laravel with php7.3
server {
server_name DOMAIN_NAME;
access_log /var/log/nginx/DOMAIN_NAME_access.log;
error_log /var/log/nginx/DOMAIN_NAME_error.log;
rewrite_log on;
root /var/www/DOMAIN_NAME/public;
index index.php index.html;
@thinnker
thinnker / gai.config
Created November 10, 2019 18:07 — forked from hackjutsu/gai.config
[IPv4 over IPv6 on Ubuntu] Solved the issue when connecting to archive.ubuntu.com takes too long. Edit /etc/gai.conf and uncomment line 4, which lets you keep IPv6 enabled, but sets the order of precedence to prefer IPv4 over IPv6. (http://askubuntu.com/a/354886) #tags: ubuntu, bittiger
#
# For sites which prefer IPv4 connections change the last line to
#
precedence ::ffff:0:0/96 100
@thinnker
thinnker / default nginx configuration file
Created November 9, 2019 20:03 — forked from skbr1234/default nginx configuration file
The default nginx configuration file inside /etc/nginx/sites-available/default
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@thinnker
thinnker / install.sh
Created November 9, 2019 16:01
VPS install bash script for Ubuntu 16.04
# =================== YOUR DATA ========================
SERVER_NAME="some-server-name"
SERVER_IP="111.111.11.11"
USER="someuser"
SUDO_PASSWORD="secret-password-one"
MYSQL_ROOT_PASSWORD="secret-password-two"