Skip to content

Instantly share code, notes, and snippets.

View richardkeep's full-sized avatar
🏠
:)

Richard Keep richardkeep

🏠
:)
View GitHub Profile
<?php
namespace Acme
class Post extends Model
{
protected $table = 'posts';
}
@richardkeep
richardkeep / msisdn_regex.txt
Created November 29, 2017 19:24 — forked from muya/msisdn_regex.txt
Regex for Safaricom Kenya, Airtel Kenya & Tigo Tanzania Phone Numbers
# KE
SAFARICOM: "/(\+?254|0|^){1}[-. ]?[7]{1}([0-2]{1}[0-9]{1}|[9]{1}[0-2]{1})[0-9]{6}\z/"
AIRTEL: "/(\+254|0|^){1}[-. ]?[7]{1}([3]{1}[0-9]{1}|[8]{1}[5-9])[0-9]{6}\z/"
# TZ
TIGO: "/(\+?255|0|^){1}[-. ]?([7]{1}[1]{1}[2-9]{1}|[6]{1}[57]{1}[2-9]{1})[0-9]{6}\z/"
@richardkeep
richardkeep / install.sh
Created February 19, 2019 08:08
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"
@richardkeep
richardkeep / backup-db.sh
Last active April 26, 2019 06:01
Backup databases to Dropbox
#!/usr/bin/env bash
# Setup Dropbox Oauth Access Token
# https://www.dropbox.com/developers/apps
DROPBOX_ACCESS_TOKEN=
cd ~
git clone https://github.com/andreafabrizi/Dropbox-Uploader.git
@richardkeep
richardkeep / LICENCE SUBLIME TEXT
Created March 12, 2019 19:00
Sublime Text 3 Serial key build is 3176
## Sublime Text 3 Serial key build is 3176
> * Added these lines into /etc/hosts
127.0.0.1 www.sublimetext.com
127.0.0.1 license.sublimehq.com
> * Used the license key
----- BEGIN LICENSE -----
@richardkeep
richardkeep / gist:305a66cee163827c4127516be176d0bb
Last active April 26, 2019 05:48
Resize VMWare Window (Mac OS X)
$ /Library/Application\ Support/VMware\ Tools/vmware-resolutionSet 1366 768
1366 = Width
768 = Height
Done.
@richardkeep
richardkeep / deploy.php
Created April 18, 2019 13:47 — forked from oxguy3/deploy.php
Script used to automatically deploy from GitHub to a cPanel shared hosting server
<?php
/**
* deploy.php by Hayden Schiff (oxguy3)
* Available at https://gist.github.com/oxguy3/70ea582d951d4b0f78edec282a2bebf9
*
* No rights reserved. Dedicated to public domain via CC0 1.0 Universal.
* See https://creativecommons.org/publicdomain/zero/1.0/ for terms.
*/
// random string of characters; must match the "Secret" defined in your GitHub webhook
// Place your settings in the file "Packages/User/Preferences.sublime-settings",
// which overrides the settings in here.
//
// Settings may also be placed in syntax-specific setting files, for
// example, in Packages/User/Python.sublime-settings for python files.
{
// Sets the colors used within the text area
"color_scheme": "Monokai.sublime-color-scheme",
// Note that the font_face and font_size are overridden in the platform
@richardkeep
richardkeep / bash aliases
Last active January 24, 2020 05:39
bash aliases
# Shortcuts
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
alias copyssh="pbcopy < $HOME/.ssh/id_rsa.pub"
alias shrug="echo '¯\_(ツ)_/¯' | pbcopy"
alias c="clear"
# Directories
alias gohome="cd $HOME/code"
############################
# GRAYLOG CONFIGURATION FILE
############################
#
# This is the Graylog configuration file. The file has to use ISO 8859-1/Latin-1 character encoding.
# Characters that cannot be directly represented in this encoding can be written using Unicode escapes
# as defined in https://docs.oracle.com/javase/specs/jls/se8/html/jls-3.html#jls-3.3, using the \u prefix.
# For example, \u002c.
#
# * Entries are generally expected to be a single line of the form, one of the following: