Skip to content

Instantly share code, notes, and snippets.

View zakiaziz's full-sized avatar
🔧
Makin' stuff

Zaki Aziz zakiaziz

🔧
Makin' stuff
View GitHub Profile
@fallwith
fallwith / homebrew_mysql_pass_reset.txt
Created May 23, 2011 22:10
Reset MySQL root password (Homebrew)
$> launchctl unload -w ~/Library/LaunchAgents/com.mysql.mysqld.plist
$> /usr/local/Cellar/mysql/5.5.9/bin/mysqld --basedir=/usr/local/Cellar/mysql/5.5.9 --datadir=/usr/local/Cellar/mysql/5.5.9/data --plugin-dir=/usr/local/Cellar/mysql/5.5.9/lib/plugin --log-error=/usr/local/Cellar/mysql/5.5.9/data/errors.err --pid-file=/usr/local/Cellar/mysql/5.5.9/data/pidfile.pid --skip-grant-tables
$> mysql
mysql> UPDATE mysql.user SET Password=PASSWORD('root_password') WHERE User='root';
mysql> FLUSH PRIVILEGES;
$> kill `cat /usr/local/Cellar/mysql/5.5.9/data/pidfile.pid`
@maxrice
maxrice / us-state-names-abbrevs.php
Created May 23, 2012 18:32
US State Names & Abbreviations as PHP Arrays
<?php
/* From https://www.usps.com/send/official-abbreviations.htm */
$us_state_abbrevs_names = array(
'AL'=>'ALABAMA',
'AK'=>'ALASKA',
'AS'=>'AMERICAN SAMOA',
'AZ'=>'ARIZONA',
'AR'=>'ARKANSAS',
@havvg
havvg / ajax-form.js
Created August 1, 2012 13:20
jQuery AJAX form submit with Twitter Bootstrap modal
jQuery(function($) {
$('form[data-async]').live('submit', function(event) {
var $form = $(this);
var $target = $($form.attr('data-target'));
$.ajax({
type: $form.attr('method'),
url: $form.attr('action'),
data: $form.serialize(),
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@nikcub
nikcub / README.md
Created October 4, 2012 13:06
Facebook PHP Source Code from August 2007
@meetrajesh
meetrajesh / binary_search_tree.php
Last active January 18, 2022 16:53
An efficient binary search tree (BST) implementation in PHP.
<?php
class BinarySearchTree {
private $_root;
public function __construct() {
// setup sentinal node
$this->_root = new BinarySearchNode(null);
}
public function getRoot() {
return $this->hasNode() ? $this->_root->right : null;
@lukeocodes
lukeocodes / QuickGit.php
Last active December 11, 2018 08:06
Current git version.
<?php
class QuickGit
{
/** @var int */
private $major = 1;
/** @var int */
private $minor = 0;
@jbenet
jbenet / simple-git-branching-model.md
Last active April 9, 2024 03:31
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@emmajane
emmajane / gist:59321345a81a4f5837c0
Last active February 28, 2024 16:35
JQL Syntax for the Impatient

JQL Syntax for the Impatient

There are a few JQL syntax bits to get you started:

  • AND --- allows you to add qualifiers to a list
  • != Thing --- target one thing
  • is in (List, Of, Things) --- target a bunch of things (Done, Closed, Resolved) typically
  • not in (List, of, Things) --- do not include a bunch of things
  • -1w --- relative time. You can also use -1d for day
  • "2015/3/15" --- specific dates