Skip to content

Instantly share code, notes, and snippets.

View athanasiosem's full-sized avatar

Athanasios Emmanouilidis athanasiosem

View GitHub Profile
@wojteklu
wojteklu / clean_code.md
Last active April 24, 2024 12:26
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

@ericelliott
ericelliott / essential-javascript-links.md
Last active April 22, 2024 10:15
Essential JavaScript Links
@WebReflection
WebReflection / gist:15fc0a2bbdd5afc7a669
Last active January 16, 2024 01:03
Disable multile submits

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
  Array.prototype.forEach.call(
    document.querySelectorAll('form[disablemultiplesubmits]'),
    function (form) {
      form.addEventListener('submit', this, true);
@egulhan
egulhan / solution.php
Created March 4, 2014 13:42
Solution of PHP SOAP error: looks like we got no XML document
// Source: http://www.highonphp.com/fixing-soap-exception-no-xml
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] );

Three Days of the Good Parts

Douglas Crockford

Frontend Masters - December 2015

Schedule

The First Day

  • Programming Style and Your Brain
  • And Then There Was JavaScript