Skip to content

Instantly share code, notes, and snippets.

View njugunagathere's full-sized avatar

Njuguna Gathere, Tirus njugunagathere

View GitHub Profile
"use strict";
/* A version number is useful when updating the worker logic,
allowing you to remove outdated cache entries during the update.
*/
var version = 'v1::';
/* These resources will be downloaded and cached by the service worker
during the installation process. If any resource fails to be downloaded,
then the service worker won't be installed either.
{
"short_name": "madewithlove",
"name": "madewithlove",
"icons": [
{
"src": "img/launcher-icon@2x.png",
"sizes": "96x96",
"type": "image/png"
},
{
@njugunagathere
njugunagathere / uuids.php
Created June 8, 2017 09:10 — forked from renebakx/uuids.php
Laravel 5.4 UUID Trait
<?php
namespace App\Traits;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Ramsey\Uuid\Uuid;
trait Uuids {
@njugunagathere
njugunagathere / bitbucket-pipelines.yml
Created May 20, 2017 20:45 — forked from davidperezgar/bitbucket-pipelines.yml
Bitbucket Pipelines YML to FTP
image: savjee/docker-s3website-git-ftp-deploy
pipelines:
default:
- step:
script:
- git ftp init --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://s1.closemarketing.net/domains/domain.com/public_html/
# You can specify a custom docker image from Docker Hub as your build environment.
image: samueldebruyn/debian-git
pipelines:
default:
- step:
script:
- apt-get update
- apt-get -qq install git-ftp
- git ftp init --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://youtftpsite.com/ftp-path/
# for the second push run this command instead of init
@njugunagathere
njugunagathere / bitbucket-pipelines.yml
Created May 20, 2017 20:41 — forked from mvaneijgen/bitbucket-pipelines.yml
Roots/sage compile and push to remote server via git ftp
# This is a sample build configuration for PHP.
# Check our guides at https://confluence.atlassian.com/x/VYk8Lw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
pipelines:
branches:
stage:
- step:
script:
@njugunagathere
njugunagathere / .jsbeautifyrc
Created May 5, 2017 09:27 — forked from wzup/.jsbeautifyrc
.jsbeautifyrc file example
{
// The plugin looks for a .jsbeautifyrc file in the same directory as the
// source file you're prettifying (or any directory above if it doesn't exist,
// or in your home folder if everything else fails) and uses those options
// along the default ones.
// Details: https://github.com/victorporof/Sublime-HTMLPrettify#using-your-own-jsbeautifyrc-options
// Documentation: https://github.com/einars/js-beautify/
"html": {
"allowed_file_extensions": ["htm", "html", "xhtml", "shtml", "xml", "svg", "dust"],
@njugunagathere
njugunagathere / autofs.md
Created March 19, 2017 03:19 — forked from rudelm/autofs.md
Use autofs on Mac OS X to mount network shares automatically during access

Autofs on Mac OS X

With autofs you can easily mount network volumes upon first access to the folder where you want to mount the volume. Autofs is available for many OS and is preinstalled on Mac OS X so I show you how I mounted my iTunes library folder using this method.

Prepare autofs to use a separate configuration file

autofs needs to be configured so that it knows where to gets its configuration. Edit the file '/etc/auto_master' and add the last line:

#
# Automounter master map
#

+auto_master # Use directory service

A good commit message looks like this:
Header line: explaining the commit in one line
Body of commit message is a few lines of text, explaining things
in more detail, possibly giving some background about the issue
being fixed, etc etc.
The body of the commit message can be several paragraphs, and
please do proper word-wrap and keep columns shorter than about
@njugunagathere
njugunagathere / iptables_rules.sh
Created December 4, 2016 09:58 — forked from virtualstaticvoid/iptables_rules.sh
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP