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
// Note! Use a radio button for this, not a checkbox! | |
// You need to check your database to find out the switch value | |
// e.g. <?php $switch_val = DB::only("SELECT switch FROM table WHERE user_id = $user_id"); ?> | |
// In your view/HTML | |
<script> | |
var switch = !!Number('<?php echo $switch_val ?>'); | |
switch ? $('.slider-button').addClass('on') : $('.slider-button').removeClass('on'); |
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
/** | |
* Construct feedback html for blur event on inputs and textareas | |
* @param {String} icon_msg | |
* @param {String} icon_class | |
* @return {String} html | |
*/ | |
function get_feedback_html(icon_msg, icon_class) { | |
var html = | |
'<span class="alert-msg"><i class="' + icon_class + '">' + icon_msg + '</i></span>'; | |
return html; |
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 | |
// select min(id) as id from `property` where `id` > 1; | |
DB::table($table)->select(DB::raw('min(id) as id'))->where('id', '>', $id)->id; |
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
// this is /app/start/artisan.php | |
<?php | |
/* | |
|-------------------------------------------------------------------------- | |
| Register The Artisan Commands | |
|-------------------------------------------------------------------------- | |
| | |
| Each available Artisan command must be registered with the console so |
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 | |
use Leads\Repos\LeadRepoInterface; | |
use Illuminate\Foundation\Application; | |
class ExchangeController extends BaseController { | |
private $lead; | |
private $app; |
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
ALTER TABLE XXX add column id INT NOT NULL AUTO_INCREMENT FIRST, ADD primary KEY Id(id) |
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
-- For example, a members table that has duplicate emails | |
-- Needs unique id field to work | |
create temporary table tmpTable (id int); | |
insert tmpTable | |
(id) | |
select id | |
from members m | |
where exists |
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
@if (App::environment() == 'local') | |
@foreach (DB::getQueryLog() as $query) | |
<script>console.log(' {{ $query['query'] . ' (' . $query['time'] . ' secs)' }} ')</script> | |
@endforeach | |
@endif |
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
<overview> | |
pf = new function | |
comm = new function comment | |
fopen = open a form | |
fclose = close a form | |
</overview> | |
<snippet> | |
<content> | |
<![CDATA[ |
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 | |
/** | |
* Helpers for Laravel 4 | |
* Author: Anthony Vipond | |
*/ | |
// Preformat the dump and die function | |
if (!function_exists('d')) { | |
function d($mixed) { |