Skip to content

Instantly share code, notes, and snippets.

View muzfuz's full-sized avatar
🚲
I like to ride my bike

Mazin Power muzfuz

🚲
I like to ride my bike
View GitHub Profile
@muzfuz
muzfuz / rails_callbacks.md
Last active October 14, 2016 08:49
Rails Callback Order

##Rails Callback Order of Execution - With and Without state_machines

###Rails Callback Order

  • (-) save
  • (-) valid
  • (1) before_validation
  • (-) validate
  • (2) after_validation
  • (3) before_save
@muzfuz
muzfuz / bitbucket_ssh_config.md
Last active December 22, 2015 21:47
Configure SSH keys for both Bitbucket and Github

#Instructions for enabling your local machine to use both BitBucket and GitHub

Ok, so you want to configure your machine to use BitBucket. The options are:

  1. Use the SourceTree Client
  2. Configure SSH to use git with Terminal

The first one is self explanatory, so we will focus on the second one.

If you want to use BitBucket via Terminal, chances are you want to configure SSH, and also are already using GitHub.

@muzfuz
muzfuz / install_couchdb.sh
Last active August 21, 2018 16:12
Bash script that installs CouchDB on Amazon Linux EC2 (2015.09)
#!/bin/bash
#This script is tuned to install CouchDB on an Amazon Linux (2015.09) EC2 Instance
#Documented here:
#https://cwiki.apache.org/confluence/display/COUCHDB/Amazon+Linux
#Install tools
sudo yum -y --enablerepo=epel groupinstall "Development Tools"
sudo yum -y --enablerepo=epel install perl-Test-Harness erlang-erts erlang-os_mon erlang-eunit libicu-devel autoconf-archive curl-devel erlang-etap erlang-asn1 erlang-xmerl js-devel
@muzfuz
muzfuz / callbacks.md
Last active October 20, 2015 20:13
The introduction to callbacks that I wish I'd had.

The introduction to JavaScript callbacks that I wish I'd had when I was starting out.

When I first started learning to code, I found the concept of callbacks extremely confusing. Which is funny, because I was using them all the time without realising it - If you currently use jQuery, then you are already using callbacks. (More on this later).

So here's my attempt to try and explain callbacks in as simple a way as I can. I'll probably gloss over some details here, but keep in mind this is a beginner's guide. If you see any glaring errors, feel free to ask me to change it.

So here goes:

##Basic definition: ####A callback is a function that is passed as an argument to another function.