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\Support\Facades\Route; | |
function path_to_user_profile_image($filename) | |
{ | |
if ($filename != '') { | |
return url('img/children/' . $filename); | |
} | |
return url('img/default_child.png'); |
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 | |
if (!defined('_PS_VERSION_')) { | |
exit; | |
} | |
class Lf_settings extends Module | |
{ | |
private $settings = [ | |
'lf_settings_support_email' => '[email protected]', | |
'lf_settings_support_phone_1' => '+33 333 33333333', |
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 DateService | |
{ | |
/** | |
* Return number of day in the week in an European manner, | |
* 0 is Monday, 6 is Sunday | |
* @param $unixTimestamp integer | |
* @return integer |
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 | |
// this script uses https://github.com/fzaninotto/Faker | |
// to generate male/female names: | |
require 'vendor/autoload.php'; | |
// use the factory to create a Faker\Generator instance | |
$faker = Faker\Factory::create(); | |
// generate data by accessing properties | |
$maleNames = []; |
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 | |
//to generate: https://gist.github.com/YavorK/f91780cd29a290fd7b9846f97ab8cf17 | |
$maleNames = array ( | |
0 => 'Jamey Bogan', | |
1 => 'Dr. Afton Crona V', | |
2 => 'Ronaldo Bahringer PhD', | |
3 => 'Dr. Korbin Feeney I', | |
4 => 'Jamil Beer', |
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 | |
return [ | |
/* | |
|-------------------------------------------------------------------------- | |
| Default Remote Connection Name | |
|-------------------------------------------------------------------------- | |
| | |
| Here you may specify the default connection that will be used for SSH |
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 | |
//import db from original server to local one... | |
/** | |
* Instructions: | |
* 1. Install this package: https://laravelcollective.com/docs/5.3/ssh | |
* 2. Add those to your .env file and fill up the values: | |
ORIGINAL_SERVER_SSH_ADDRESS= | |
ORIGINAL_SERVER_SSH_USERNAME= |
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 | |
Artisan::command('db:port-original', function () { | |
//Laravel Remote is AWESOEM // https://laravelcollective.com/docs/5.3/ssh#sftp-downloads ... | |
//make sure process does not get killed | |
set_time_limit(0); | |
//define some values | |
$archiveName = env('ORIGINAL_SERVER_DB_DUMP_ARCHIVE_NAME'); |
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 < 5.3.6 | |
foreach (debug_backtrace() as $trace) | |
{ | |
echo sprintf("\n%s:%s %s::%s", $trace['file'], $trace['line'], $trace['class'], $trace['function']); | |
} | |
die; | |
// PHP >= 5.3.6 | |
debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); | |
die; |
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
@if ($errors->any()) | |
<div class="alert alert-danger"> | |
@foreach ($errors->all() as $error) | |
{!! $error !!}<br/> | |
@endforeach | |
</div> | |
@endif | |
@if (Session::get('flash_success')) | |
<div class="alert alert-success"> | |
@if(is_array(Session::get('flash_success'))) |