Skip to content

Instantly share code, notes, and snippets.

View abodacs's full-sized avatar

Abdullah Mohammed abodacs

View GitHub Profile
@abodacs
abodacs / rules-to-write-better-commit-messages.md
Created October 3, 2018 21:17 — forked from medhatdawoud/rules-to-write-better-commit-messages.md
This gist is the summary of a video on YouTube [in Arabic] you can watch from here: https://youtu.be/BTlL-LBDCSI

Rules to write a better commit message

These are my preferences for a good commit message, feel free to fork this gist and add your own standards, or add comment here to share yours with the community.

1. Include only the files related to the feature you are implementing:

  • Don't add any file that is not related to the main issue, you can make it in a separate commit.
  • Separating files that not related is important in the revert cases.
  • Revise the whole changes always before committing and make sure to mention each change you made in the message.

2. Commit subject should be concise and reflect the essence of the commit:

  • Imagine the commit as an Email to the owner or your team mates.
  • Subject in the first and main sentence of the commit, it should be concise and to the point.
  • It shouldn't exceed 50 char.
@abodacs
abodacs / mysql-5.7-tuning-parameters
Created January 14, 2018 23:27 — forked from xiangchu0/mysql-5.7-tuning-parameters
mysql-5.7-tuning-parameters
intel_idle.max_cstate=0 idle=poll quiet cgroup_enable=memory crashkernel=256M intel_pstate=disable
[mysql]
default-character-set=utf8mb4
user = root
password = 123456
port = 3306
socket = /tmp/mysqld.sock
prompt="\u@\h \d>"
@abodacs
abodacs / System Design.md
Created January 5, 2018 12:42 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
PROJECT LICENSE
This project was submitted by Lara Martín as part of the Nanodegree At Udacity.
As part of Udacity Honor code, your submissions must be your own work, hence
submitting this project as yours will cause you to break the Udacity Honor Code
and the suspension of your account.
Me, the author of the project, allow you to check the code as a reference, but if
you submit it, it's your own responsibility if you get expelled.
import struct
import time
import numpy as np
from tornado.tcpserver import TCPServer
from tornado.tcpclient import TCPClient
from tornado.ioloop import IOLoop
from tornado import gen
--- my.cnf for 5.6.35
[mysqld]
sql_mode=no_engine_substitution,no_unsigned_subtraction
default_tmp_storage_engine=MyISAM
tmpdir=/data/m/my
query_cache_size=0
query_cache_type=0
long_query_time=5
log_bin=/data/m/my/binlogs/bl
from concurrent.futures import ThreadPoolExecutor
from datetime import timedelta
from tornado import gen
from tornado.concurrent import run_on_executor
THREADPOOL_MAX_WORKERS = 10
THREADPOOL_TIMEOUT_SECS = 30
def onthread(function):
@abodacs
abodacs / gist:a8456946970d8f8d7b49a26f7c595f69
Created May 3, 2017 22:01 — forked from ImEagle/gist:8609243
Tornado + Django models
# https://bitbucket.org/yml/dj_tornado/src/c9a11ce11d4c/dj_tornado.py
import sys
import os
import tornado.httpserver
import tornado.ioloop
import tornado.web
# django settings must be called before importing models
@abodacs
abodacs / flake8.xml
Created August 2, 2016 10:24 — forked from stantonk/flake8.xml
PyCharm Flake8 Configuration XML File
<!-- Drop this in ~/Library/Preferences/PyCharm20/tools -->
<!-- make sure you set the path to flake8 executable for your machine in the COMMAND option -->
<?xml version="1.0" encoding="UTF-8"?>
<toolSet name="Flake8">
<tool name="Flake8 File" showInMainMenu="true" showInEditor="true" showInProject="true" showInSearchPopup="false" disabled="false" useConsole="true" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="/usr/local/share/python/flake8" />
<option name="PARAMETERS" value="--max-line-length=120 --ignore=E301,E302,E261,E262,W404 $FileDir$/$FileName$" />
<option name="WORKING_DIRECTORY" value="$FileDir$" />
@abodacs
abodacs / External Tools.xml
Created August 2, 2016 10:24 — forked from dArignac/External Tools.xml
PyCharm flake8 (~/PyCharm40/config/tools)
<toolSet name="External Tools">
<tool name="flake8 File" showInMainMenu="true" showInEditor="true" showInProject="true" showInSearchPopup="true" disabled="false" useConsole="true" showConsoleOnStdOut="false" showConsoleOnStdErr="false" synchronizeAfterRun="true">
<exec>
<option name="COMMAND" value="/usr/bin/flake8" />
<option name="PARAMETERS" value="--max-line-length=160 --ignore=E501,E128 --exclude=migrations $FileDir$/$FileName$" />
<option name="WORKING_DIRECTORY" value="$FileDir$" />
</exec>
<filter>
<option name="NAME" value="Flake8 Output Filter" />
<option name="DESCRIPTION" />