Skip to content

Instantly share code, notes, and snippets.

View fmtarif's full-sized avatar

Faisal Muhammad fmtarif

View GitHub Profile
@fmtarif
fmtarif / readme.md
Created June 18, 2017 06:39
#vagrant VT-x vs Hyper-V note
@fmtarif
fmtarif / testrun-johnpapa-boilerplate.sh
Created May 29, 2017 07:51
#linux #angular Test run John papa boilerplate on a droplet
#this is what i needed to do to run the following on a 512MB digitalocean droplet
#https://github.com/johnpapa/generator-hottowel
apt-get update
chmod -R g+rwx /root /root/.config /root/.config/configstore
npm install -g yo
npm install -g gulp bower nodemon generator-hottowel
cd /home
mkdir app
@fmtarif
fmtarif / dbbackup.sh
Last active May 21, 2017 15:33
#linux #sysadmin #scripts simple DB backup
#!/bin/bash
#BACKUP_DIR="$HOME/backups/"
BACKUP_DIR="./"
FILENAME="dbdump-$(date +%F_%Hh-%Mm-%Ss).sql"
DB_NAME="dbname"
DB_USER="username"
DB_PWD=""
@fmtarif
fmtarif / archive-day-2_chp2-3.md
Last active December 8, 2018 14:13
#pattern #code Head First Design Patterns - Notes

book cover

Quick recap of Day 1

In software engineering, a software design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. It is not a finished design that can be transformed directly into source or machine code. It is a description or template for how to solve a problem that can be used in many different situations.

Source: Wikipedia

Most patterns address issues of change in software

@fmtarif
fmtarif / one-liner-desc.md
Last active October 28, 2022 11:38
#code #pattern Design pattern notes

One-liner descriptions

Sources

  1. Gang of Four Book (Wikipedia)
  2. Wikipedia Definitions

Note: The table row definitions are in these order.

Creational patterns

Creational patterns are ones that create objects for you, rather than having you instantiate objects directly. This gives your program more flexibility in deciding which objects need to be created for a given case.

@fmtarif
fmtarif / tree.php
Created March 15, 2017 16:37
#php Recursive function that creates a parent children nested array of unlimited hierarchy
<?php
/**
* @param $elements format like following
* [
'id' => 1,
'name' => 'root1',
'parent_id' => 0
]
*/
@fmtarif
fmtarif / index.md
Created March 15, 2017 16:27
#php #html #upload Form enctype values
@fmtarif
fmtarif / cron.md
Last active October 23, 2017 15:17
#linux #cli crontab shortcuts
@fmtarif
fmtarif / baseModel.php
Last active April 19, 2022 11:53
#laravel #php A query scope for sorting and searching/filtering
<?php
/**
* Use this query scope from any model/controller
* It works on single table only, so for joined columns, make a mysql view and operate on that
* Example request fromat
*/
/*
[
'query' => [
@fmtarif
fmtarif / default-nice-fonts.css
Created February 16, 2017 08:11
#css default nice fonts
/*from https://hackernoon.com/10-things-i-learned-making-the-fastest-site-in-the-world-18a0e1cdf4a7#d27e */
body {
color: #212121;
font-family: "Helvetica Neue", "Calibri Light", Roboto, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
letter-spacing: 0.02em;
}