Skip to content

Instantly share code, notes, and snippets.

David Cook dacook

  • Melbourne, Australia
Block or report user

Report or block dacook

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View pretty git history
##
# Creates an alias called "git hist" that outputs a nicely formatted git log.
# Usage is just like "git log"
# Examples:
# git hist
# git hist -5
# git hist <branch_name>
# git hist <tag_name> -10
##
git config --global alias.hist "log --pretty=format:'%C(yellow)%ad%C(reset) %C(green)%h%C(reset) %C(red)%an%C(reset): %s %C(blue)%d%C(reset)' --graph --date=short"
View convertFourSpacesToTwo.sublime-macro
[
{
"args": {
"setting": "tab_size",
"value": 4
},
"command": "set_setting"
},
{
"args":
@dacook
dacook / gist:9b08a34fb65cfe9c0b04
Last active Aug 29, 2015
Behaviours that I think should be standard on all web pages
View gist:9b08a34fb65cfe9c0b04

which are not done by browsers by default. Therefore this list is a potential guide for a boilerplate JS/CSS. TODO: expand into a better format, with examples and reasoning behind each item.

Important

  1. Highlight elements that have been scrolled into view by the URL hash (eg #my-anchor) example
  2. All headings or sections should be linkable anchors (eg #my-heading). This might need a bit more defining.
  3. Any linkable anchors should indicate they're linkable with a hover state, and should be easy to copy the link. example
  4. Disable internal links with no target (ie href="#" -> on click{e.preventDefault()})

Less important

@dacook
dacook / fusionTablesQuery
Created Jan 15, 2014
Simple Javascript function to test a google.maps.FusionTablesQuery object, with JSON response. More improvements can be made..
View fusionTablesQuery
/*
* fusionTablesQuery()
*
* Query a Fusion Table with JSON response.
*
* Parameters:
* @query: google.maps.FusionTablesQuery (only some options implemented so far) (ref: https://developers.google.com/maps/documentation/javascript/reference#FusionTablesQuery)
* @callback: function(jsonResult)
*
View database.yml
development:
adapter: postgresql
database: development
username: <%= ENV['PG_USER'] %>
password: <%= ENV['PG_PASS'] %>
host: localhost
You can’t perform that action at this time.