Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Brian Matovu mtvbrianking

🎯
Focusing
Block or report user

Report or block mtvbrianking

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mtvbrianking
mtvbrianking / auto-deploying.md
Created Jun 26, 2019 — forked from nickbclifford/auto-deploying.md
How to automatically deploy code to a server using Travis CI
View auto-deploying.md

Auto-Deploying via Travis CI

Because Travis CI can automatically execute scripts after successfully (or unsuccessfully!) executing tests, it is an obvious choice for a deployment tool. In order to deploy to a Git repository on a remote server, the process generally is as follows:

  • Set up SSH keys
  • Add the server's copy of the repository as a Git remote
  • Push to the remote
  • SSH into the server and execute any installation/compilation/miscellaneous commands

Before even touching .travis.yml...

Users

@mtvbrianking
mtvbrianking / install_lamp_18.sh
Created May 8, 2019 — forked from ankurk91/install_lamp_18.sh
Ubuntu 18.04 - PHP development (php 7.2, MySQL 5.7, apache 2.4)
View install_lamp_18.sh
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# Ubuntu 18.04 dev Server
# Run like - bash install_lamp.sh
# Script should auto terminate on errors
echo -e "\e[96m Adding PPA \e[39m"
sudo add-apt-repository -y ppa:ondrej/apache2
View route-patterns.php
// Common Route Patterns http://laravel-tricks.com/tricks/routing-patterns
// Patterns
Route::pattern('id', '\d+');
Route::pattern('hash', '[a-z0-9]+');
Route::pattern('hex', '[a-f0-9]+');
Route::pattern('uuid', '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}');
Route::pattern('base', '[a-zA-Z0-9]+');
Route::pattern('slug', '[a-z0-9-]+');
Route::pattern('username', '[a-z0-9_-]{3,16}');
View Good-CONTRIBUTING.md-template.md

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@mtvbrianking
mtvbrianking / .env.travis
Created Jun 15, 2018 — forked from gilbitron/.env.travis
Laravel 5 Travis CI config
View .env.travis
APP_ENV=testing
APP_KEY=SomeRandomString
DB_CONNECTION=testing
DB_TEST_USERNAME=root
DB_TEST_PASSWORD=
CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
View Function.Array-Group-By.php
<?php
if (!function_exists('array_group_by')) {
/**
* Groups an array by a given key.
*
* Groups an array into arrays by a given key, or set of keys, shared between all array members.
*
* Based on {@author Jake Zatecky}'s {@link https://github.com/jakezatecky/array_group_by array_group_by()} function.
* This variant allows $key to be closures.
View golang-create-read-write-delete-file.go
package main
import (
"fmt"
"io"
"os"
)
var path = "/Users/novalagung/Documents/temp/test.txt"
@mtvbrianking
mtvbrianking / training.sh
Created Mar 6, 2017 — forked from christianroman/training.sh
Tesseract OCR training new font
View training.sh
#! /bin/bash
# build the environment
mkdir tessenv; cd tessenv
TROOT=`pwd`
mkdir $TROOT/stockfonts; mkdir $TROOT/build; mkdir $TROOT/build/eng
echo "Environment built"
# Get the stock english fonts from Google (old, but they work)
cd $TROOT/stockfonts
GET http://tesseract-ocr.googlecode.com/files/boxtiff-2.01.eng.tar.gz > boxtiff-2.01.eng.tar.gz
@mtvbrianking
mtvbrianking / ffmpeg_install.md
Created Feb 10, 2017 — forked from jmsaavedra/ffmpeg_install.md
Install FFmpeg on a Linux Box
View ffmpeg_install.md

###Install FFmpeg via CLI on Linux box

These steps walk through installing a static binary of any ffmpeg version on to your linux machine. If you want to compile from source, there are several ways to do so. Here's the official guide. Tested and works on an AWS EC2 Ubuntu instance, but should work on any Linux machine.

#####http://ffmpeg.org

  • SSH into your instance and become root
@mtvbrianking
mtvbrianking / webcam-cv2.py
Created Jan 23, 2017 — forked from tedmiston/webcam-cv2.py
Display the webcam in Python using OpenCV (cv2)
View webcam-cv2.py
'''
Simply display the contents of the webcam with optional mirroring using OpenCV
via the new Pythonic cv2 interface. Press <esc> to quit.
'''
import cv2
def show_webcam(mirror=False):
cam = cv2.VideoCapture(0)
while True:
You can’t perform that action at this time.