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
@for ($i = 0; $i < 10; $i++) | |
The current value is {{ $i }} | |
@endfor | |
@foreach ($users as $user) | |
<p>This is user {{ $user->id }}</p> | |
@endforeach | |
@forelse($users as $user) | |
<li>{{ $user->name }}</li> |
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
<!-- Stored in app/views/layouts/master.blade.php --> | |
<html> | |
<body> | |
@section('sidebar') | |
This is the master sidebar. | |
@show | |
<div class="container"> | |
@yield('content') |
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 UserController extends BaseController { | |
/** | |
* The layout that should be used for responses. | |
*/ | |
protected $layout = 'layouts.master'; | |
/** | |
* Show the user profile. | |
*/ |
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
find ./ -type f -name \*.php -exec php -l {} \; | grep "Errors parsing "; |
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
%s/pattern-here//gn |
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 | |
$useDevDb = false; | |
if (isset($_SERVER['ENVIRONMENT']) && $_SERVER['ENVIRONMENT'] == 'PRODUCTION') { | |
$useDevDB = false; | |
} elseif ((isset($_SERVER['ENVIRONMENT'])) | |
&& $_SERVER['ENVIRONMENT'] == 'DEVELOPMENT' | |
|| $_SERVER['ENVIRONMENT'] == 'BETA') { |
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 | |
// How to insert using Kohana's Database class. Always forget the syntax... | |
$result = DB::insert('table', array('field1', 'field2', 'field3')) | |
->values(array('value1', 'value2', 'value3')) | |
->execute(); | |
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
git config --global merge.tool diffconflicts git config --global mergetool.diffconflicts.cmd 'diffconflicts vim $BASE $LOCAL $REMOTE $MERGED' git config --global mergetool.diffconflicts.trustExitCode true git config --global mergetool.diffconflicts.keepBackup false |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
find . -size +1G | cat >> .gitignore |
NewerOlder