Skip to content

Instantly share code, notes, and snippets.

View hayzem's full-sized avatar

Ali hayzem

  • Istanbul
View GitHub Profile
@hayzem
hayzem / decronym.php
Created October 12, 2017 09:50 — forked from Two9A/decronym.php
Decronym: A simple Reddit bot
<?php
/**
* Dirty, dirty Reddit bot: Decronym
*/
class Reddit {
const USERNAME = 'Decronym';
const PASSWORD = '***';
const CLIENTID = '***';
const SECRET = '***';
@hayzem
hayzem / pre-commit-hook.sh
Created October 10, 2017 12:38
Bash script for PHP CS Fix with git pre-commit hook
#!/usr/bin/env bash
git status|grep -E "(.php)"| cut -d':' -f 2| while read -r line ; do
echo "php cs fix: $line"
/usr/local/bin/php /usr/local/bin/php-cs-fixer fix ${line} --rules=@Symfony
done
@hayzem
hayzem / gist:bf65cedaf85c0a20b6d3f70d7d25e65d
Created October 6, 2017 22:44
rabbitmq add user to admin
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
@hayzem
hayzem / docker-cleanup.sh
Created April 17, 2017 10:54
Docker remove all container and images!
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@hayzem
hayzem / docker-install-debian-jessie
Created April 15, 2017 17:09
Install Docker for Debian/Jessie
#!/bin/bash
# compiled from https://docs.docker.com/engine/installation/linux/debian/#/debian-jessie-80-64-bit
sudo apt-get update
sudo apt-get dist-upgrade -y
sudo apt-get install apt-transport-https ca-certificates -y
sudo sh -c "echo deb https://apt.dockerproject.org/repo debian-jessie main > /etc/apt/sources.list.d/docker.list"
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
@hayzem
hayzem / form.html
Last active April 12, 2017 12:25
Wordpress Admin Page UI Form Elements
<div class="wrap">
<?php screen_icon(); ?>
<h2><?php esc_html_e( 'Forms' ); ?></h2>
<form>
<table class="form-table">
<tbody>
<tr>