Install git:
sudo apt-get install git
Configure Git:
touch ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
git config --global user.name "Your Name"
git config --global user.email "Your Email"
| (function($) { | |
| $(function() { | |
| $(".print").live('click', function(e) { | |
| e.preventDefault(); | |
| // remove old printframe | |
| $("#printframe").remove(); | |
| // create new printframe |
| /*! | |
| * Dynamically changing favicons with JavaScript | |
| * Works in all A-grade browsers except Safari and Internet Explorer | |
| * Demo: http://mathiasbynens.be/demo/dynamic-favicons | |
| */ | |
| // HTML5™, baby! http://mathiasbynens.be/notes/document-head | |
| document.head || (document.head = document.getElementsByTagName('head')[0]); | |
| function changeFavicon(src) { |
| # This works: | |
| # @return [String] This is attribute #1 | |
| attr_reader :attr1 | |
| # @return [Object] This is attribute #2 | |
| attr_reader :attr2 | |
| # But this won't: |
| $.fn.truncateLines = function(options) { | |
| options = $.extend($.fn.truncateLines.defaults, options); | |
| return this.each(function(index, container) { | |
| container = $(container); | |
| var containerLineHeight = Math.ceil(parseFloat(container.css('line-height'))); | |
| var maxHeight = options.lines * containerLineHeight; | |
| var truncated = false; | |
| var truncatedText = $.trim(container.text()); | |
| var overflowRatio = container.height() / maxHeight; |
| if test -z $1 | |
| then | |
| echo "$0 : You must set a project name" | |
| exit 1 | |
| else | |
| if test -d /srv/sites/$1/www/ | |
| then | |
| # fix permission issues | |
| echo "fix permissions" | |
| cd /srv/sites/$1/ |
Install git:
sudo apt-get install git
Configure Git:
touch ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
git config --global user.name "Your Name"
git config --global user.email "Your Email"
| FILE SPACING: | |
| # double space a file | |
| sed G | |
| # double space a file which already has blank lines in it. Output file | |
| # should contain no more than one blank line between lines of text. | |
| sed '/^$/d;G' |
| <?php | |
| // source: http://www.paulferrett.com/2009/php-camel-case-functions/ | |
| /** | |
| * Translates a camel case string into a string with underscores (e.g. firstName -> first_name) | |
| * @param string $str String in camel case format | |
| * @return string $str Translated into underscore format | |
| */ | |
| function from_camel_case($str) { | |
| $str[0] = strtolower($str[0]); |