View _git-objects-restore.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
#!/usr/local/bin/php | |
<?php | |
define('DIR', 'tree'); | |
define('FILE', 'blob'); | |
function main() { | |
$root_object = 'f3c8ec92f83e2a87c1d00a5681598126e23ab356'; | |
restore_object($root_object, 'restored'); | |
} |
View ruleset.xml
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"?> | |
<ruleset name="CustomCfg"> | |
<description> | |
PSR2 style guide + tab indent instead of space. | |
</description> | |
<arg name="tab-width" value="4"/> | |
<rule ref="PSR2"> | |
<exclude name="Generic.WhiteSpace.DisallowTabIndent" /> |
View .env
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
STRIPE_SECRET_KEY=XXXXXXX | |
STRIPE_PUBLIC_KEY=YYYYYYY |
View An Example Controller.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 namespace App\Http\Controllers\Party; | |
use App\Http\Controllers\Controller as BaseController; | |
use App\Party; | |
use Session; | |
use Redirect; | |
use Request; | |
use URL; | |
class Rsvp extends BaseController { |
View usage.js
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
function getPageHistory() { | |
var hist = $.cookie('history'); | |
try { | |
hist = JSON.parse(hist); | |
if (false == $.isArray(hist)) hist = []; | |
} | |
catch (e) | |
{ |
View 01_actual.blade.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
<div class="campaign-property-container"> | |
<div class="campaign-property-value"> | |
<? if ($Campaign->started()): ?> | |
<? if ($Campaign->running()): ?> | |
<span class="campaign-status mod-running">Running</span> | |
<? elseif ($Campaign->ended()): ?> | |
<span class="campaign-status mod-ended">Ended</span> | |
<? elseif ($Campaign->pending()): ?> | |
<span class="campaign-status mod-scheduled">Scheduled</span> | |
<? endif; ?> |
View NoCache.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 namespace App\Http\Middleware; | |
use Closure; | |
class NoCache { | |
/** | |
* Handle an incoming request. | |
* | |
* @param \Illuminate\Http\Request $request |
View gist:178bd0fcb8ff73b3b233
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 callable_test.php | |
bool(false) | |
bool(true) | |
<?php | |
class Test { | |
public function __invoke() {} | |
} | |
var_dump(is_callable('Test')); |
View gist:e68e4011ebd4f4850762
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
function closureify(callable $fn) | |
{ | |
return function() use ($fn) { | |
return call_user_func_array($fn, func_get_args()); | |
}; | |
} |
View gist:317467dc97fc436e994e
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
$ mysql -e 'show slave status \G' -u root | grep "Running: No" | |
$ echo $? | |
1 | |
$ mysql -e 'show slave status \G' -u root | grep "Running" | |
Slave_IO_Running: Yes | |
Slave_SQL_Running: Yes | |
$ echo $? | |
0 |
NewerOlder