Skip to content

Instantly share code, notes, and snippets.

View waifung0207's full-sized avatar

Michael Chan waifung0207

View GitHub Profile
@waifung0207
waifung0207 / install_oci8_ubuntu_18.04_php7.2.md
Last active December 12, 2019 03:10 — forked from hewerthomn/install_oci8_ubuntu_16.04_php7.1.md
How to install OCI8 on Ubuntu 16.04 and PHP 7.1
#!/bin/sh
# Start Steam on Ubuntu Linux with NVIDIA display card
LC_ALL=C steam
@waifung0207
waifung0207 / setup.sh
Last active August 29, 2015 14:27
Ubuntu 14.04 LAMP Setup
#!/bin/bash
# upgrade existing packages
sudo apt-get update && sudo apt-get -y upgrade
# set timezone
sudo dpkg-reconfigure tzdata
# install Apache server
sudo apt-get install -y apache2
@waifung0207
waifung0207 / website.conf
Last active September 28, 2022 03:22
Apache Virtual Host Config with HTTPS redirect and URL rewrite
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
# force HTTPS
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
@waifung0207
waifung0207 / gist:837482a6f85096445230
Last active August 29, 2015 14:14
Sample of Apache config vs Nginx config
<VirtualHost *:80>
DocumentRoot /var/www/dev
<Directory /var/www/dev>
Options -Indexes FollowSymLinks -MultiViews
AllowOverride All
Order allow,deny
allow from all
@waifung0207
waifung0207 / crontab
Created November 4, 2014 06:28
Server Cron Job Sample
0 0 * * * /home/username/run_cron.sh
@waifung0207
waifung0207 / email.php
Created July 16, 2014 14:08
CodeIgniter email config file (Mailgun custom domain + TLS)
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| EMAIL CONFING
| -------------------------------------------------------------------
| Configuration of outgoing mail server.
| */
$config['protocol'] = 'smtp';
@waifung0207
waifung0207 / email.php
Created July 16, 2014 14:05
CodeIgniter email config file (Gmail)
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
| -------------------------------------------------------------------
| EMAIL CONFING
| -------------------------------------------------------------------
| Configuration of outgoing mail server.
| */
$config['protocol'] = 'smtp';
@waifung0207
waifung0207 / Gruntfile.coffee
Last active August 29, 2015 14:03
Gruntfile template (CoffeeScript) for Phaser development
# Reference: https://github.com/gamecook/phaser-project-template
module.exports = (grunt) ->
# Package
# =======
pkg = require './package.json'
# Configuration
# =============
grunt.initConfig
@waifung0207
waifung0207 / 0_reuse_code.js
Created February 20, 2014 15:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console