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 | |
| # Instead of | |
| $name = 'Jeff'; | |
| switch ($name) { | |
| case 'Jeff': | |
| echo "I'm Jeff"; | |
| break; | |
| case 'Joe': |
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
| $(window).scroll(function() { | |
| var scroll = $(window).scrollTop(); | |
| if (scroll > 50) { | |
| $(".menu-bar").addClass("menu-bar-scroll"); | |
| } else { | |
| $(".menu-bar").removeClass("menu-bar-scroll"); | |
| } | |
| }); | |
| (function(){ |
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
| /* | |
| <a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request | |
| - Or, request confirmation in the process - | |
| <a href="posts/2" data-method="delete" data-confirm="Are you sure?"> | |
| */ | |
| (function() { |
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
| $(document).ready(function() { | |
| // Add click handler to hyperlinks to send restful DELETE requests | |
| // | |
| // Example: | |
| // | |
| // <a href="/delete/1" class="rest-delete">delete</a> | |
| // <script>restful.init($('.rest-delete'));</script> | |
| // | |
| var restful = { |
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 | |
| class PhotoApiTest extends TestCase { | |
| public function setUp() | |
| { | |
| parent::setUp(); | |
| Route::enableFilters(); |
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($, undefined) { | |
| // Shorthand to make it a little easier to call public laravel functions from within laravel.js | |
| var laravel; | |
| $.laravel = laravel = { | |
| // Link elements bound by jquery-ujs | |
| linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]', | |
| // Select elements bound by jquery-ujs | |
| inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]', |
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
| var o = $({}); | |
| $.subscribe = o.on.bind(o); | |
| $.publish = o.trigger.bind(o); |
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 | |
| // more: http://baylorrae.com/php-pubsub/ | |
| class PubSub | |
| { | |
| private static $events = array(); // all subscriptions | |
| // Don't allow PubSub to be initialized outside this class |
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 | |
| $I = new TestGuy($scenario); | |
| $I->wantTo('register for a new account'); | |
| $I->amOnPage('/register'); | |
| $I->see('Register', 'h1'); | |
| $I->fillField('email', 'joe@sample.com'); | |
| $I->fillField('Password:', 'password'); | |
| $I->click('Register'); |
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($, undefined) { | |
| // Shorthand to make it a little easier to call public laravel functions from within laravel.js | |
| var laravel; | |
| $.laravel = laravel = { | |
| // Link elements bound by jquery-ujs | |
| linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]', | |
| // Select elements bound by jquery-ujs | |
| inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]', |