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 | |
$peoples = array( | |
array("name" => "jeffrey", "age" => 28), | |
array("name" => "john", "age" => 20) | |
); | |
// the common way | |
function array_pluck($toPluck, $arr) { | |
$ret = array(); | |
foreach($arr as $item) { |
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
sudo apt-get update | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root' | |
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root' | |
sudo apt-get install -y vim curl python-software-properties | |
sudo add-apt-repository -y ppa:ondrej/php5 | |
sudo apt-get update | |
sudo apt-get install -y php5 apache2 libapache2-mod-php5 php5-curl php5-gd php5-mcrypt php5-readline mysql-server-5.5 php5-mysql git-core php5-xdebug |
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
C:\>bcdedit /copy {current} /d "No Hyper-V" | |
The entry was successfully copied to {ff-23-113-824e-5c5144ea}. | |
C:\>bcdedit /set {ff-23-113-824e-5c5144ea} hypervisorlaunchtype off | |
The operation completed successfully. | |
Afsluiten met shift ingedrukt. Other OS. Dan 'No Hyper-V' kiezen. |
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
ctags -R --exclude=.git --exclude=log * |
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 | |
if ( ! function_exists('refdate')) | |
{ | |
/** | |
* $datum datum in wat dan ook voor formaat (ook unix) | |
* $outputformat d-m-Y / y-m-d / ... of unix / mysql | |
* result datum in gewenste formaat | |
* anders 'Error' en error message in log-file | |
* | |
* Gebruik met uitkomsten |
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 | |
// edit app/config/local/database.php -> 'log' => true | |
// @ http://stackoverflow.com/questions/19131731/laravel-4-logging-sql-queries | |
if (Config::get('database.log', false)) { | |
Event::listen('illuminate.query', function($query, $bindings, $time, $name) { | |
$data = compact('bindings', 'time', 'name'); | |
// Format binding data for sql insertion | |
foreach ($bindings as $i => $binding) { |
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 | |
Route::get('lev', function() | |
{ | |
$a = [ 'Rotterdam', 'Capelle a/d IJssel', 'Nieuwerkerk a/d IJssel', 'Maassluis', 'Schiedam', '\'s Gravenhage', 'Vlaardingen']; | |
// $b = 'niewekek IJssel'; // match | |
// $b = 'niewkek IJssel'; // geen match | |
// $b = 'Capelle a/d IJssel'; // match | |
// $b = 'capelle ijssel'; // match | |
// $b = 'gravenh'; // geen match |
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
#!bash/sh | |
sudo apt-get install apache2 -y | |
sudo apt-get install mysql-server -y | |
sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt php5-curl -y | |
sudo php5enmod mcrypt | |
sudo /etc/init.d/apache2 restart | |
sudo apt-get install git-core -y | |
sudo apt-get install curl wget -y | |
curl –sS https://getcomposer.org/installer | php | |
sudo mv composer.phar /usr/bin/composer |
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 | |
use Illuminate\Console\Command; | |
use Illuminate\Filesystem\Filesystem; | |
class ViewsCommand extends Command { | |
/** | |
* The console command name. | |
* | |
* @var string |
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 |
OlderNewer