This file contains 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
{ | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/User/Espresso Soda.tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"file_exclude_patterns": [ | |
".DS_Store", | |
"dump.rdb" | |
], | |
"folder_exclude_patterns": [ | |
".git", |
This file contains 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
$app->match('/export', function() use($app){ | |
$sql = 'SELECT * FROM partial_customers'; | |
$records = $app['db']->fetchAll($sql); | |
header("Content-Type: text/csv"); | |
header("Content-Disposition: attachment; filename=partial_customers.csv"); | |
header("Pragma: no-cache"); | |
header("Expires: 0"); | |
$output = fopen("php://output", "w"); |
This file contains 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($){ | |
$.fn.toggleDisabled = function(){ | |
return this.each(function(){ | |
var $this = $(this); | |
if ($this.attr('disabled')) | |
$this.removeAttr('disabled'); | |
else | |
$this.attr('disabled', 'disabled'); | |
}); | |
}; |
This file contains 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
// Placeholder support for IE and older browsers. | |
// http://www.femgeek.co.uk/html5-placeholders-for-troublesome-browsers-ie-ie9/ | |
$(function() { | |
if(!$.support.placeholder) { | |
var active = document.activeElement; | |
$('textarea').each(function(index, element) { | |
if($(this).val().length == 0) { | |
$(this).html($(this).attr('id')).addClass('hasPlaceholder'); | |
} | |
}); |
This file contains 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 validate_email_address($email) { | |
return filter_var($email, FILTER_VALIDATE_EMAIL) && preg_match('/@.+\./', $email); | |
} |
This file contains 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
sudo apt-get update | |
sudo apt-get install tasksel | |
sudo tasksel | |
sudo apt-get install php5-curl | |
sudo apt-get install curl | |
sudo apt-get install git-core | |
sudo apt-get install vim | |
sudo apt-get install phpmyadmin |
This file contains 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 dump() | |
{ | |
$args = func_get_args(); | |
echo "\n<pre style=\"border:1px solid #ccc;padding:10px;margin:10px;font:14px courier;background:whitesmoke;display:block;border-radius:4px;\">\n"; | |
$trace = debug_backtrace(false); | |
$offset = (@$trace[2]['function'] === 'dump_d') ? 2 : 0; | |
echo "<span style=\"color:red\">" . @$trace[1+$offset]['class'] . "</span>:" . |
This file contains 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
{ | |
"files": | |
{ | |
"jquery": "http://code.jquery.com/jquery.min.js", | |
"angularjs" : "http://code.angularjs.org/1.0.6/angular-1.0.6.zip", | |
"jquery.cycle-2" : "http://malsup.github.io/min/jquery.cycle2.min.js" | |
}, | |
"packages": | |
{ | |
"html5_boilerplate": "https://github.com/h5bp/html5-boilerplate/zipball/master", |
This file contains 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
$.fn.setAllToMaxHeight = function(){ | |
return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) ); | |
} | |
// usage: $(‘div.unevenheights’).setAllToMaxHeight() |
This file contains 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
sudo add-apt-repository ppa:webupd8team/sublime-text-2 | |
sudo apt-get update | |
sudo apt-get install sublime-text |
OlderNewer