Skip to content

Instantly share code, notes, and snippets.


Athanasios Emmanouilidis athanasiosem

View GitHub Profile
wojteklu /
Last active Sep 29, 2020
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.

General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules


Three Days of the Good Parts

Douglas Crockford

Frontend Masters - December 2015


The First Day

  • Programming Style and Your Brain
  • And Then There Was JavaScript
View gist:15fc0a2bbdd5afc7a669

Coming from this post, the solution is very simple and doesn't need jQuery.

This is the function that will disable multiple submits to any form that has such attribute

function disableMultipleSubmits() { // by Andrea Giammarchi - WTFPL
    function (form) {
      form.addEventListener('submit', this, true);
stevevance / ssp.class.psql.php
Created May 22, 2014
DataTables server-side processing that works with v1.10.0 and PostgreSQL
View ssp.class.psql.php
* Helper functions for building a DataTables server-side processing SQL query
* The static functions in this class are just helper functions to help build
* the SQL used in the DataTables demo server-side processing scripts. These
* functions obviously do not represent all that can be done with server-side
* processing, they are intentionally simple to show how it works. More complex
* server-side processing operations will likely require a custom script.
egulhan / solution.php
Created Mar 4, 2014
Solution of PHP SOAP error: looks like we got no XML document
View solution.php
// Source:
class SoapClientNG extends \SoapClient{
public function __doRequest($req, $location, $action, $version = SOAP_1_1){
$xml = explode("\r\n", parent::__doRequest($req, $location, $action, $version));
$response = preg_replace( '/^(\x00\x00\xFE\xFF|\xFF\xFE\x00\x00|\xFE\xFF|\xFF\xFE|\xEF\xBB\xBF)/', "", $xml[0] );
You can’t perform that action at this time.