Skip to content

Instantly share code, notes, and snippets.

View Azhovan's full-sized avatar
🎯
Log the error and degrade gracefully!

Jabar Asadi Azhovan

🎯
Log the error and degrade gracefully!
View GitHub Profile
@Azhovan
Azhovan / mac-setup-redis.md
Created May 7, 2020 21:48 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@Azhovan
Azhovan / supervisord.conf
Created June 17, 2018 12:04 — forked from jasonamyers/supervisord.conf
A sample supervisor config file
; Sample supervisor config file.
;
; For more information on the config file, please see:
; http://supervisord.org/configuration.html
;
; Note: shell expansion ("~" or "$HOME") is not supported. Environment
; variables can be expanded using this syntax: "%(ENV_HOME)s".
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
@Azhovan
Azhovan / 1_phpunit-api.md
Created December 3, 2017 13:11 — forked from loonies/1_phpunit-api.md
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this->anything()
@Azhovan
Azhovan / install.sh
Created November 24, 2017 07:35 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
<?php
class DemoSubject implements SplSubject{
private $observer, $value;
public function __construct(){
$this->observers = array();
}
@Azhovan
Azhovan / gist:a5d7f1dc5199f53e13609b3f4deabb54
Created May 14, 2017 07:02 — forked from iambigd/gist:10952128
Generating an API Signature - Kayako Developer Resources - Kayako Wiki
<?php
$apiKey = "apikey";
$secretKey = "secretkey";
// Generates a random string of ten digits
$salt = mt_rand();
// Computes the signature by hashing the salt with the secret key as the key
@Azhovan
Azhovan / vagrant-cheat-sheet.md
Created December 18, 2016 14:22 — forked from wpscholar/vagrant-cheat-sheet.md
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Common Vagrant Commands

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
  • vagrant status -- outputs status of the vagrant machine
  • vagrant halt -- stops the vagrant machine
  • vagrant reload -- restarts vagrant machine, loads new Vagrantfile configuration
  • vagrant provision -- forces reprovisioning of the vagrant machine