This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pake_desc('Update the README with the latest command output'); | |
pake_task('readme'); | |
function run_readme() | |
{ | |
pake_echo_comment('Updating README documentation'); | |
$startPoint = '## Help'; | |
$endPoint = '## Examples'; | |
$readme = file_get_contents('README.md'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// # 404 Handler for JS in Dev Environment | |
// | |
// I kept stubbing my toe. Backbone can make it hard to notice that a file | |
// has returned a 404 unless you have the console open. This makes it much | |
// more noticeable. | |
// | |
// This is coupled with the .htaccess file entry: | |
// | |
// RewriteCond %{REQUEST_FILENAME} !-f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// # Simple Url Parsing via DOM. | |
// ----------------------------------------------------------------------------- | |
// | |
// * Author: Craig Davis <[email protected]> | |
// | |
define([], function(undefined) { | |
var a = document.createElement('a'); | |
return function (url) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// usage: {{fromNow date}} | |
Handlebars.registerHelper('fromNow', function(date) { | |
moment = new Moment(date); | |
return moment.fromNow(); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// usage: {{pluralize collection.length 'quiz' 'quizzes'}} | |
Handlebars.registerHelper('pluralize', function(number, single, plural) { | |
return (number === 1) ? single : plural; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class package_dev_tools | |
{ | |
package | |
{ | |
'git-core': | |
ensure => present | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
var methodMap = { | |
'create': 'POST', | |
'update': 'PUT', | |
'delete': 'DELETE', | |
'read' : 'GET' | |
}; | |
var getUrl = function(object) { | |
if (!(object && object.url)) return null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
md.host `Host`, | |
md.user `User`, | |
md.db `Database`, | |
REPLACE(RTRIM(CONCAT( | |
IF(md.Select_priv = 'Y', 'Select ', ''), | |
IF(md.Insert_priv = 'Y', 'Insert ', ''), | |
IF(md.Update_priv = 'Y', 'Update ', ''), | |
IF(md.Delete_priv = 'Y', 'Delete ', ''), | |
IF(md.Create_priv = 'Y', 'Create ', ''), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#NOTE: .pydistutils.cfg seems to be not compatible with brew install python | |
#areas I needed to clean before installation | |
#clean up ~/Library/Python | |
#clean up .local | |
brew install python --framework | |
easy_install pip | |
pip install virtualenv | |
pip install virtualenvwrapper | |
mkdir $HOME/.virtualenvs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Seed random generator | |
RANDOM=$$$(date +%s) | |
# Random from 5..15 | |
COUNT=$((RANDOM % 15 + 5)) | |
# Random activity | |
EXERCISES=( |