Skip to content

Instantly share code, notes, and snippets.

@faizzed
faizzed / Laravel - Composer Package Development
Last active August 10, 2019 08:19
Laravel package development
Use case:
--------
-> Adding a local package to composer.
-> directory structure:
+root
+packages
+username
#!/usr/bin/env bash
if [ "$1" == "" ]; then
printf "Can not commit with out a message. exiting!\n"
exit
fi
git add -A && git commit -m "$1";
@faizzed
faizzed / request.php
Last active February 23, 2020 08:30
php curl request module
<?php
/**
* A nice little request module using php curl,
* handy for looking up things quickly. Not intended for any major purpose
* or tweak it yourself
*
* @param $url string
* @param $method string
* @param $data array
#! /usr/bin/env bash
# setting compound GOPATH @ ~/.bashrc
# 3rd party libraries
export GOPATH=~/go/lib
export PATH=$PATH:$GOPATH/bin
# personal workspace
export GOPATH=$GOPATH:~/go/projects
#!/usr/bin/env bash
if [ "$1" == "" ]; then
printf "First argument should be filename.."
exit
fi
file="$1"
### Set initial time of file
@faizzed
faizzed / php_console_logging.php
Created March 9, 2020 12:57
PHP - A simple class for logging into stderr
<?php
class Console
{
private $stderr = null;
private $line = null;
const END = '\e[0m';
const BOLD = '\e[1m';
const DIM = '\e[2m';
const ITALIC = '\e[3m';
@faizzed
faizzed / out.sh
Created April 10, 2020 12:09
Color print text in console
#!/usr/bin/env bash
END='\e[0m';
BOLD='\e[1m';
DIM='\e[2m';
ITALIC='\e[3m';
UNDERLING='\e[4m';
BLINK='\e[5m';
GHOST='\e[8m';
STRIKE_THROUGH='\e[9m';
@faizzed
faizzed / Setting-up-docker-sync-on-MAC.md
Last active August 9, 2020 12:48
Setting up docker sync on MAC

Install docker-sync

sudo gem install docker-sync

Add docker-sync volumes

docker-sync.yml

version: "2"
syncs:
  
@faizzed
faizzed / create_nginx_server.sh
Last active August 11, 2020 15:34
This script creates a starter nginx server block, install ssl cert, setup a src directory and add entry to hosts file. Written for OSX.
#!/usr/bin/env bash
printf "
---\n
This script will do the following:\n
- Make an nginx server config\n
- Create an ssl cert for it\n
- Add the cert to trusted cert db.\n
- Make a src folder ready to to be edited.\n\n
This is just to get started faster. Please make relevant edits.
--\n";
server {
  listen 80;
  server_name mydomain.com;
  #
  #
  #
  #
  location / {
 access_log off;