<?php
$x = false or true;
// => true
var_export($x);
// => false
$y = false || true;
// => true
var_export($y);
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() { | |
// written with jQuery | |
$('.dribbble-link img').each(function(i, e) { | |
e = $(e); | |
e.attr('src', e.attr('src').replace('_teaser', '')); | |
}); | |
$('ol.dribbbles li.group').css('width', '420px'); |
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 TestCase extends Illuminate\Foundation\Testing\TestCase { | |
// ... | |
public function appMock($name) | |
{ | |
$mock = Mockery::mock($name); | |
App::instance($name, $mock); |
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
/* | |
run with: | |
portsmouthClassifier.classify(marks); | |
*/ | |
var portsmouthClassifier = (function() { | |
var totalCredits = function(year) { | |
return _.reduce(year, function(memo, unit) { | |
return memo + unit.credits; |
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
#!/bin/sh | |
# | |
# This hook does two things: | |
# | |
# 1. update the "info" files that allow the list of references to be | |
# queries over dumb transports such as http | |
# | |
# 2. if this repository looks like it is a non-bare repository, and | |
# the checked-out branch is pushed to, then update the working copy. | |
# This makes "push" function somewhat similarly to darcs and bzr. |
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
wget https://www.successphotography.com/traceimagefreepp.php?gpr=131196571000{1..9}&gpi= && \ | |
wget https://www.successphotography.com/traceimagefreepp.php?gpr=13119657100{10..99}&gpi= && \ | |
wget https://www.successphotography.com/traceimagefreepp.php?gpr=1311965710{100..342}&gpi= |
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
// this is the background code... | |
// listen for our browerAction to be clicked | |
chrome.browserAction.onClicked.addListener(function (tab) { | |
// for the current tab, inject the "inject.js" file & execute it | |
chrome.tabs.executeScript(tab.ib, { | |
file: 'inject.js' | |
}); | |
}); |
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 xhr = new XMLHttpRequest(); | |
xhr.upload.addEventListener('progress', function(e) { | |
var percent = parseInt(e.loaded / e.total * 100, 10)+'%'; | |
console.log('progress', percent); | |
}, false); | |
xhr.onreadystatechange = function(e) { | |
if (xhr.readyState === 4 && xhr.status === 200) { | |
console.log('done!'); |
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 Category extends Eloquent { | |
use EloquentSingleTableInheritenceTrait; | |
protected function singleTableInheritanceMpa() | |
{ | |
return [ | |
1 => 'InventoryCategory', |
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 | |
use Illuminate\Database\Eloquent\Collection; | |
class BaseCollection extends Collection { | |
public function sortByOrder($order, $delimeter = ',') | |
{ | |
$order = is_array($order) ? $order : explode($delimeter, $order); | |