Skip to content

Instantly share code, notes, and snippets.

View dilantha's full-sized avatar

Dilantha Nanayakkara dilantha

View GitHub Profile
@wojteklu
wojteklu / clean_code.md
Last active January 5, 2026 03:23
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

@choiceforyou
choiceforyou / gitCleanLocal.md
Created July 24, 2015 04:40
Commands in one line to cleanup branches in git folder

git checkout master && git pull && git branch --merged master | grep -v master | xargs -n 1 git branch -d

Multiple PHP version under Ubuntu 14.04

Update your machine

apt-get update
apt-get upgrade

Install some dependencies

apt-get install build-essential

@JeffreyWay
JeffreyWay / bootstrap.sh
Created October 23, 2013 19:28
Beginning bootstrap.sh file for https://laracasts.com/lessons/vagrant-simplified lesson.
#!/usr/bin/env bash
sudo apt-get update
sudo apt-get install -y python-software-properties
sudo add-apt-repository -y ppa:ondrej/php5
sudo apt-get update
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active January 5, 2026 04:09
A badass list of frontend development resources I collected over time.
@philsturgeon
philsturgeon / gist:5465246
Last active May 23, 2022 12:29
API Golden Rules

Never Expose DB Results Directly

  1. If you rename a field, then your users are fucked. Convert with a hardcoded array structure.
  2. Most DB drivers [for PHP] will show integers as numeric strings and false as "0", so you want to typecast them.
  3. Unless you're using an ORM with "hidden" functionality, people will see passwords, salts and all sorts of fancy codes. If you add one and forget to put it in your $hidden array then OOPS!

Use the URI sparingly, and correctly

  1. Use the query string for paired params instead of /users/id/5/active/true. Your API does not need to be SEO optimised.
  2. ?format=xml is stupid, use an Accept: application/xml header. I added this to the CodeIgniter Rest Server once for lazy people, and now people think it's a thing. It's not.
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@simenbrekken
simenbrekken / README.md
Created March 8, 2012 06:39
Super simple Backbone + Express + MongoDB REST backend application

Requirements:

If you're on OSX you're probably best off using Homebrew to install this stuff:

$ brew install node mongodb

Usage:

@tsabat
tsabat / zsh.md
Last active January 3, 2026 06:27
Getting oh-my-zsh to work in Ubuntu
@pithyless
pithyless / gist:1208841
Created September 10, 2011 21:49
Install Python 2.7 (homebrew + pip + virtualenv) on Mac OS X Lion

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7

Symlinks...