Skip to content

Instantly share code, notes, and snippets.

View fmtarif's full-sized avatar

Faisal Muhammad fmtarif

View GitHub Profile
start = moment().hour(6).minute(0);
output = [];
for (i=1; i<33; i++) {
from = start.format('h:mm')
to = start.add('30', 'm').format('h:mm');
output.push(`#${i}: ${from}-${to} - `);
}
console.log(output.join("\n"));
@fmtarif
fmtarif / readme.md
Created December 16, 2017 07:26
#php php 7 benchmark
@fmtarif
fmtarif / ping.sh
Created December 5, 2017 04:42
#cli #bash ping sites and echo IP
#! /bin/bash
for s in $(cat sites.txt); do
ip=$(ping -c 1 $s | gawk -F'[()]' '/PING/{print $2}')
echo "$s: $ip"
done
@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 / readme.md
Created October 7, 2017 03:53
Timeline of popular programming languages

Timeline of popular programming languages

From: https://en.wikipedia.org/wiki/Timeline_of_programming_languages

Year Language Developer/Company Predecessor(s)
1969 B Ken Thompson, with contributions from Dennis Ritchie BCPL
1972 Smalltalk Alan Kay, Adele Goldberg, Dan Ingalls, Xerox PARC Simula 67
1972 C Dennis Ritchie B, BCPL, ALGOL 68
1983 Objective-C Brad Cox Smalltalk, C
@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>