Skip to content

Instantly share code, notes, and snippets.

View fmtarif's full-sized avatar

Faisal Muhammad fmtarif

View GitHub Profile
@fmtarif
fmtarif / webdev_online_resources.md
Created January 29, 2019 16:18 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)
@fmtarif
fmtarif / angular-error-handling.js
Created April 16, 2018 12:56 — forked from abyx/angular-error-handling.js
AngularJS HTTP Error Handling Mechanism
var HEADER_NAME = 'MyApp-Handle-Errors-Generically';
var specificallyHandleInProgress = false;
angular.module('myApp').factory('RequestsErrorHandler', ['$q', function($q) {
return {
// --- The user's API for claiming responsiblity for requests ---
specificallyHandled: function(specificallyHandledBlock) {
specificallyHandleInProgress = true;
try {
return specificallyHandledBlock();
@fmtarif
fmtarif / angularjs-providers-explained.md
Last active February 28, 2018 10:42 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider

call order: jsfiddle link

Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes
@fmtarif
fmtarif / install-choco-script.bat
Last active May 14, 2019 07:37 — forked from zaccb/install-choco-script.bat
#cli #windows Chocolatey install script (PowerShell) - Install software and web development dependencies automatically in Windows through a script
:: Open Windows PowerShell in Administrative mode and run this file, i.e., ./install-choco-script.bat
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
:: Install Applications
choco install vcredist2010 -fy
choco install flashplayerplugin -fy
choco install k-litecodecpackfull -fy
choco install ffmpeg -fy
choco install jre8 -fy
choco install javaruntime -fy
@fmtarif
fmtarif / README.md
Last active October 23, 2017 15:14 — forked from hofmannsven/README.md
#mysql #cli MySQL Command Line Cheatsheet
@fmtarif
fmtarif / mysql-cheat-sheet.md
Created October 23, 2017 15:13
#mysql MySql Cheat Sheet
@fmtarif
fmtarif / gist:9bb5b5bfdc3c19e246cb73e6f0a13d7f
Last active November 16, 2017 06:36 — forked from dopa/gist:5245868
#cli #mysql Shell Script to Back Up all MySQL Databases, Keep 7 Days of Backups
#!/bin/bash
# Script will output dumps for all databases using seperate files
# Derived from this post: http://www.cyberciti.biz/faq/ubuntu-linux-mysql-nas-ftp-backup-script/
USER="user"
PASSWORD="password"
HOST="localhost"
MYSQL="$(which mysql)"
MYSQLDUMP="$(which mysqldump)"
OUTPUT_DIR="/backups/files"
@fmtarif
fmtarif / dump.sh
Created October 22, 2017 08:26 — forked from andsens/dump.sh
#cli #mysql Backup all MySQL databases into separate files
#!/bin/sh
## backup each mysql db into a different file, rather than one big file
## as with --all-databases. This will make restores easier.
## To backup a single database simply add the db name as a parameter (or multiple dbs)
## Putting the script in /var/backups/mysql seems sensible... on a debian machine that is
## Create the user and directories
# mkdir -p /var/backups/mysql/databases
# useradd --home-dir /var/backups/mysql --gid backup --no-create-home mysql-backup
## Remember to make the script executable, and unreadable by others
@fmtarif
fmtarif / angularjs_directive_attribute_explanation.md
Created September 26, 2017 17:13 — forked from CMCDragonkai/angularjs_directive_attribute_explanation.md
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@fmtarif
fmtarif / xampp_php7_xdebug.md
Created September 16, 2017 14:51 — forked from odan/xampp_php7_xdebug.md
Installing Xdebug for XAMPP