NodeJS:
Url: http://nodejs.org/
Required for: npm to install Bower
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 ($errors->any()) | |
<div class="alert alert-error alert-block"> | |
<button type="button" class="close" data-dismiss="alert">×</button> | |
<h4>Error</h4> | |
Please check the form below for errors | |
</div> | |
@endif | |
@if ($message = Session::get('success')) | |
<div class="alert alert-success alert-block"> |
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
// 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 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
/** | |
* jQuery String Padding Function | |
* Only supports left padding. | |
* @link http://stv.whtly.com/2009/02/27/simple-jquery-string-padding-function/ | |
**/ | |
$.strPad = function(i,l,s) { | |
var o = i.toString(); | |
if (!s) { s = '0'; } | |
while (o.length < l) { | |
o = s + o; |
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 | |
/** | |
* SplClassLoader implementation that implements the technical interoperability | |
* standards for PHP 5.3 namespaces and class names. | |
* | |
* http://groups.google.com/group/php-standards/web/final-proposal | |
* | |
* // Example which loads classes for the Doctrine Common package in the | |
* // Doctrine\Common namespace. |
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 | |
$env = $app->detectEnvironment( | |
function() | |
{ | |
if (isset($_SERVER['HTTP_HOST'])) | |
{ | |
switch ( $_SERVER['HTTP_HOST'] ) | |
{ | |
case 'example.local': | |
$env = 'local'; |
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 | |
$routeExists = Route::getRoutes()->hasNamedRoute('route.name'); | |
dd($routeExits); |
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
# Running xdebug in the console, for debugging Laravel artisan commands. Useful as I keep forgetting this one... | |
php -dxdebug.remote_autostart artisan | |
#Running phpcs for 5.3: | |
phpcs -pv --standards= --runtime-set testVersion 5.3 --ignore=*/public/*,*.js,*.css,*/tests/*,*/views/training/* . |
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 | |
// CSRF Protection | |
$this->beforeFilter('csrf', array('on' => 'post')); |
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 | |
function check_alive($url, $timeout = 10, $successOn = array(200, 301)) { | |
$ch = curl_init($url); | |
// Set request options | |
curl_setopt_array($ch, array( | |
CURLOPT_FOLLOWLOCATION => false, | |
CURLOPT_NOBODY => true, | |
CURLOPT_TIMEOUT => $timeout, |