Skip to content

Instantly share code, notes, and snippets.

View atainton's full-sized avatar

Andrew Tainton atainton

  • Offerzen
  • Cape Town, South Africa
View GitHub Profile
@atainton
atainton / bidding.rb
Last active November 21, 2022 12:12
SimplePay Bidding class
class Agent
# This will already be implemented and is not part of this exercise
def initialize; end
# This will return the amount (integer) by which the agent wants to increase its bid
# (i.e. how much they want to add onto their bid as it stands so far)
# This will already be implemented and is not part of this exercise
def get_bid_increase; end
end
credit to https://github.com/mdkrog
git checkout development
git pull origin development
git checkout your-local-branch
git rebase -i development
git push -f origin your-local-branch
git checkout development
git merge your-local-branch --ff-only
git push origin development
@atainton
atainton / gist:33d6b35c6b7397b8f5d4
Created February 4, 2016 13:28 — forked from mdkrog/gist:fa05e06dddc18e91c093
Remove remote branch
# soft delete
git branch -d -r remote_name/branch_name
# hard delete
git push origin :branchname
@atainton
atainton / gist:1d76fa788f948104ded5
Created February 4, 2016 13:28 — forked from mdkrog/gist:2149d877a814b3dec60e
Get Rid of duplicate versions of gems in gem files
bundle clean --force
@atainton
atainton / gist:a30fe28a03867ccbdaff
Created February 4, 2016 13:28 — forked from mdkrog/gist:1bfeb86c38a1d65d11e0
List Directory Sizes
du -h --max-depth=1 | sort -hr
@atainton
atainton / gist:c30c2e07a2bb894ec3c9
Created February 4, 2016 13:26 — forked from AlexanderRD/gist:485f12395cc30f3444b7
Delete all git branches with prefix
git branch -D `git branch | grep 'ard_*'`
git log --all --pretty=format:'%h %cd %s (%an)' --since='7 days ago'
git log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
@atainton
atainton / gist:4c8787bb44dd2cfb289c
Created February 4, 2016 13:23 — forked from ryannealmes/gist:d112483d59563bc11499
mysql database dumps + restores
Dump:
mysqldump -u USERNAME -p PASSWORD DBTODUMP > /path/to/DUMPFILE.sql
Import:
mysql -u USERNAME -p PASSWORD DBTOIMPORTTO < /path/to/DUMPFILE.sql/
@atainton
atainton / gist:2929ebf2326f2ec90c5c
Created May 18, 2015 10:09
Get Column names mysql work bench
SELECT FROM INFORMATION_SCHEMA.COLUMNS
SELECT TABLE_NAME, COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS