Skip to content

Instantly share code, notes, and snippets.

@abrahamfast
abrahamfast / .tmux-config
Created March 17, 2017 18:11
tmux confg
set-option -g default-shell /bin/zsh
@abrahamfast
abrahamfast / composer.sh
Created November 27, 2016 06:07
install compoer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === 'aa96f26c2b67226a324c27919f1eb05f21c248b987e6195cad9690d5c1ff713d53020a02ac8c217dbf90a7eacc9d141d') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
@abrahamfast
abrahamfast / 0_reuse_code.js
Created November 27, 2016 06:04
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@abrahamfast
abrahamfast / install.sh
Created November 21, 2016 10:09
install php 7
Introduction
PHP 7, which was released on December 3, 2015, promises substantial speed improvements over previous versions of the language, along with new features like scalar type hinting. This guide explains how to quickly upgrade an Apache or Nginx web server running PHP 5.x (any release) to PHP 7, using community-provided packages.
Warning: As with most major-version language releases, it's best to wait a little while before switching to PHP 7 in production. In the meanwhile, it's a good time to test your applications for compatibility with the new release, perform benchmarks, and familiarize yourself with new language features.
If you have installed phpMyAdmin for database management, it is strongly recommended that you wait for official CentOS PHP 7 packages before upgrading, as phpMyAdmin packages do not yet support the upgrade. If you're running any other services or applications with active users, it is safest to first test this process in a staging environment.
Prerequisites
This guide assumes t
@abrahamfast
abrahamfast / password_regex.js
Last active November 11, 2016 08:16
perfect password regex in js
var bad = /(?=.{8,}).*/;
//Alpha Numeric plus minimum 8
var good = /^(?=\S*?[a-z])(?=\S*?[0-9])\S{8,}$/;
//Must contain at least one upper case letter, one lower case letter and (one number OR one special char).
var better = /^(?=\S*?[A-Z])(?=\S*?[a-z])((?=\S*?[0-9])|(?=\S*?[^\w\*]))\S{8,}$/;
//Must contain at least one upper case letter, one lower case letter and (one number AND one special char).
var best = /^(?=\S*?[A-Z])(?=\S*?[a-z])(?=\S*?[0-9])(?=\S*?[^\w\*])\S{8,}$/;
$('#password').on('keyup', function () {
var password = $(this);
@abrahamfast
abrahamfast / .bash_profile_git_command
Last active October 1, 2016 06:17
git command line shortcuts
# ----------------------
# Git Aliases
# ----------------------
alias ga='git add'
alias gaa='git add .'
alias gaaa='git add -A'
alias gb='git branch'
alias gbd='git branch -d '
alias gc='git commit'
alias gcm='git commit -m'
@abrahamfast
abrahamfast / install.sh
Created September 26, 2016 10:10
install mysql
how to install mysql in linux
https://community.nitrous.io/docs/mysql
```sh
mysql --version
sudo apt-get update
sudo apt-get install mysql-server libapache2-mod-auth-mysql
sudo mysql_install_db
@abrahamfast
abrahamfast / gist:b9e367a0dafd1500475f3c3263a6c85a
Created September 26, 2016 06:50
php-fpm fix error install laravel or any composer
Problem 1
- Installation request for laravel/framework v5.2.16 -> satisfiable by laravel/framework[v5.2.16].
- laravel/framework v5.2.16 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
To enable extensions, verify that they are enabled in those .ini files:
- /etc/php/7.0/cli/php.ini
- /etc/php/7.0/cli/conf.d/10-mysqlnd.ini
- /etc/php/7.0/cli/conf.d/10-opcache.ini
- /etc/php/7.0/cli/conf.d/10-pdo.ini
- /etc/php/7.0/cli/conf.d/20-calendar.ini
@abrahamfast
abrahamfast / vue-route.php
Created August 21, 2016 06:56
vue route in laravel
<?php
Route::get('/{vue_capture?}', function () {
return view('home');
})->where('vue_capture', '[\/\w\.-]*');
response_init {
"response":"[object] (stdClass: {\"result\":2314,\"source\":\"JEL\",\"error\":\"Domain [ShabakeGostar] ascii: [ShabakeGostar] not available.\",\"params\":{\"session\":\"3cx3ef297d6863da59b485c24a3b4037aee\",\"actionkey\":\"\",\"settings\":{\"engine\":\"php5.4\",\"sslstate\":false},\"domain\":\"ShabakeGostar\",\"appid\":\"1dd8d191d38fff45e62564fcf67fdcd6\"},\"methodName\":\"createEnv\"})",
"result":0,
"debug":"[object] (stdClass: {\"time\":2808,\"cpu\":{\"time\":1295,\"usage\":\"1\"}})"
}