Skip to content

Instantly share code, notes, and snippets.


Ayman Farhat aymanfarhat

View GitHub Profile
aymanfarhat / docker-compose.yml
Last active Dec 5, 2019
Example of docker-izing a wordpress setup in docker-compose
View docker-compose.yml
version: '3.3'
image: mysql:5.7
- db_data:/var/lib/mysql
restart: always
MYSQL_ROOT_PASSWORD: somewordpress
apt-get update
echo "[Install] Build essential"
sudo apt-get install build-essential
echo "[Install] Python software properties"
apt-get install python-software-properties
echo "[Install] git"
apt-get install git
View swift_mail.php
$to = array('');
// setup Swift mailer parameters
$transport = Swift_SmtpTransport::newInstance( '', 465, 'ssl');
$transport->setUsername('aymanfarhat ');
$swift = Swift_Mailer::newInstance( $transport );
// create a message (subject)
def file_to_list(fname):
f = open(fname)
lst = f.readlines()
return [line.rstrip('\n') for line in lst]
def list_to_file(fname, lst):
f = open(fname, "w")
aymanfarhat /
Created May 21, 2014
Start a project and its common windows with tmux
if [ -z "$1" ] ; then
echo "usage: $0 <projectname> [/path/to/project]"
exit 1
if [ -z "$2" ] ; then
aymanfarhat / code_team_guidelines.txt
Last active Aug 29, 2015
A list of guidelines that every dev team should decide on for a project
View code_team_guidelines.txt
- Tab vs spaces
- Common Git workflow
- Code style to enforce
- variable naming conventions
- function naming convention
- Namespaces
- check PSR
- semantic versioning (
- JS linting with JSHint
- CSS pre-processor SASS vs LESS
aymanfarhat / tweet_this.js
Created Mar 26, 2014
Simple Twitter intent generator
View tweet_this.js
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="../../assets/ico/favicon.ico">
aymanfarhat /
Created Jan 1, 2014
Python snippet for sending email using unix sendmail
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from subprocess import Popen, PIPE
html = MIMEText("<html><head><title>Test Email</title></head><body>Some HTML</body>", "html")
msg = MIMEMultipart("alternative")
msg["From"] = ""
msg["To"] = ""
msg["Subject"] = "Python sendmail test"
View file.json
"title":"Tool Title",
"description": "Tool Description",
"version": "",
"author": {
"repository_url": "",
View game.js
// shim later with setTimeout fallback
window.requestAnimFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function( callback ){
window.setTimeout(callback, 1000 / 60);
You can’t perform that action at this time.