I hereby claim:
- I am mikehins on github.
- I am mikehins (https://keybase.io/mikehins) on keybase.
- I have a public key ASCW6Wc-gQe9xWBpZGeEprTkF8Lj2ktKVVlWbzrQw-cZogo
To claim this, I am signing this object:
$(document).ready(function() { | |
// ---------------------------- | |
// Show message if data have been modified without saving first | |
// ---------------------------- | |
var CHANGED = false; | |
window.onbeforeunload = function() { | |
return (CHANGED == true ? "Leaving Page with unsaved changes" : null); | |
} | |
// ---------------------------- |
// console.log | |
$.fn.extend({debug: function(msg){ | |
return $(document).each(function() { | |
if (window.console && window.console.log) window.console.log(msg); | |
}); | |
} | |
}); | |
// minified | |
(function($){$.extend({log:function(e){return $(document).each(function(){if(window.console&&window.console.log)window.console.log(e)})}})}(jQuery)); |
windows/system32/drivers/etc/hosts | |
127.0.0.1 www.mysite.dev | |
wamp\bin\apache\apache2.4.2\conf\httpd.conf | |
Listen 80 | |
Listen 8080 | |
wamp\bin\apache\apache2.4.2\conf\extra\httpd-vhosts.conf\httpd-vhosts.conf | |
<VirtualHost *:80> | |
DocumentRoot E:/Wamp/www/mysite |
function json_replace($key, $value, $json_string) | |
{ | |
return preg_replace('/"' . $key . '":".*?"/', '"' . $key . '":"' . $value . '"', $json_string); | |
} |
var AJAX = { | |
post: function (u, d, dt, cb) { | |
dt = typeof dt !== 'undefined' ? dt : 'json'; | |
return $.ajax({ | |
url: u, | |
data: d, | |
type: 'POST', | |
dataType: dt | |
}); |
<?php | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreateTranslationsTable extends Migration | |
{ | |
/** | |
* Run the migrations. |
I hereby claim:
To claim this, I am signing this object:
Je dois migrer / transformer la bd de prod vers celle de staging à chaque soir avec le scheduler.
j'ai un peux plus que 100 000 records à transformer par table, y a une table avec au dessus de 250 000 records en f*** json qui faut que je sépare en plusieurs autres relations
$schedule->command('acme:command1')->timezone('America/Toronto')->dailyAt('20:00')->after(function(){
$this->call('acme:command2');
$this->call('acme:command3');
$this->call('acme:command4');
public function whereJSON($key, $value) | |
{ | |
$fields = explode('.', $key); | |
if (count($fields) !== 2) { | |
die('Please use this format field_name.key to query JSON'); | |
} | |
$fieldname = $fields[0]; | |
return $this->whereRaw($fieldname . ' REGEXP \'"' . $fields[1] . '":"([^"]*)' . $value . '([^"]*)"\'')->get() | |
->map(function ($item) use ($fieldname) { |
$unique = array_intersect_key($array, array_unique(array_column($array, 'email'))); |