I wrote this four years ago, so instead use this command:
$ docker rmi $(docker images -q -f dangling=true)
| #https://gorails.com/setup/ubuntu/14.04 | |
| sudo apt-get update | |
| sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties | |
| sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev | |
| curl -L https://get.rvm.io | bash -s stable | |
| source ~/.rvm/scripts/rvm | |
| echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc | |
| rvm install 2.1.2 | |
| rvm use 2.1.2 --default |
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
Other people's projects:
My projects (tutorials are on my blog at http://maxoffsky.com):
| /** | |
| * Get a random floating point number between `min` and `max`. | |
| * | |
| * @param {number} min - min number | |
| * @param {number} max - max number | |
| * @return {number} a random floating point number | |
| */ | |
| function getRandomFloat(min, max) { | |
| return Math.random() * (max - min) + min; | |
| } |
| (function ($, Drupal) { | |
| Drupal.behaviors.MODULE = { | |
| attach: function(context) { | |
| // Delicious code goes here. | |
| } | |
| } |
| <?php echo $this->url->link('product/category', 'path=96'); ?> | |
| // http://example.com/category-three/ | |
| <?php echo $this->url->link('product/category', 'path=63_78'); ?> | |
| // http://example.com/category-one/category-two/ | |
| <?php echo $this->url->link('product/category', 'path=63_78_96'); ?> |
If you're like me you have a dir like ~/Workspace/Github where all your git repos live. I often find myself making a change in a repo, getting side tracked and ending up in another repo, or off doing something else all together. After a while I end up with several repos with modifications. This script helps me pick up where I left off by checking the status of all my repos, instead of having to check each one individually.
Usage:
git-status [directory]This will run git status on each repo under the directory specified. If called with no directory provided it will default to the current directory.
| <?php | |
| /** | |
| * Convert a multi-dimensional array into a single-dimensional array. | |
| * @author Sean Cannon, LitmusBox.com | [email protected] | |
| * @param array $array The multi-dimensional array. | |
| * @return array | |
| */ | |
| function array_flatten($array) { | |
| if (!is_array($array)) { |
#Views Handlers - A Shakedown
This is a cheat sheet for information about extending the capabilities of Views by extending and building your own handlers. It will cover the basic handlers and attempt to cover some of the hooks that you might use when doing so. Including examples, basic documentation and some caveats where necessary. THIS IS NOT A COMPLETE LIST!! Consider the code of the handler your looking to extend to be the ultimate source of documentation. This is merely a convenience and a starting point.
_Ignore the tags in the included snippets, they are a convenience for formatting.
views_handler_field_numeric).views_handler_field_my_numeric_field.inc.