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
SELECT table_name AS "Table", | |
round(((data_length + index_length) / 1024 / 1024), 2) "Size in MB" | |
FROM information_schema.TABLES | |
WHERE table_schema = "$DB_NAME" | |
AND table_name = "$TABLE_NAME"; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<phpunit colors="true" | |
processIsolation="true" | |
verbose="true" | |
debug="true"> | |
</phpunit> |
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
Add /app/config/database.php into the project folder .gitignore | |
Then remove it from the staging area cache with: | |
git rm --cached app/config/database.php |
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
<?php | |
// Email a URL to colleague so he can visit the Admin sessions page | |
// Current page: /admin/sessions (GET route) | |
$type = 'type'; | |
$start_date = '2012-01-01'; | |
$end_date = '2012-03-01'; | |
$session_id = '123456'; | |
$url = 'http://domain.com/admin/sessions?type=' . urlencode($type); | |
$url .= '&start_date=' . urlencode($start_date); |
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
/** | |
* Return a url segment | |
* @param {Integer} url segment wanted | |
* @return {String} URL segment | |
*/ | |
function get_path_segment(num) { | |
return location.pathname.split("/")[num].toLowerCase(); | |
} |
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
// Icons with edit class will convert their data partner to an input | |
$('i.edit').click(function() { | |
var table = $(this).data('table'); | |
var column = $(this).data('column'); | |
var relation = $(this).data('relation'); | |
var id = $(this).data('id'); | |
var type = $(this).data('type'); | |
var morph = $(this).data('morph'); | |
var original_elem = $(this).siblings('span'); | |
var original_text = original_elem.text(); |
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
<?php | |
if (!function_exists('sql')) { | |
function sql($detailed = false) { | |
if ($detailed) { | |
Event::listen("illuminate.query", function($query, $bindings, $time, $name) { | |
$queries = DB::getQueryLog(); | |
echo '<pre>'; | |
foreach(end($queries) as $item) { | |
var_dump($item); |
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
<select class="filter"> | |
<option>Results Shown</option> | |
<option>20</option> | |
<option>30</option> | |
<option>50</option> | |
<option>100</option> | |
</select> | |
<script> | |
// This example is for a 'Results per page' dropdown |
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
alias l='ls -lah' | |
alias b='cd ..' | |
alias bb='cd ../..' | |
alias bbb='cd ../../..' | |
alias ra='sudo apachectl restart' | |
alias sa='sudo apachectl start' | |
alias ka='sudo apachectl stop' | |
alias a-dir='cd /etc/apache2' | |
alias sites='cd ~/sites' |
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
/** | |
* Check if a number is an integer using jQuery | |
* @param {Number} num | |
* @return {Boolean} | |
*/ | |
function is_integer(num) { | |
return $.isNumeric(num) && !(num % 1); | |
} |