SELECT *
FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE HOST LIKE '%192.168.0.0%';
SELECT *
FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE HOST LIKE '%192.168.0.0%';
git branch --no-merged
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d
git branch --no-merged
git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d
CREATE USER 'fast'@'%'
IDENTIFIED WITH mysql_native_password AS '***';
GRANT USAGE ON *.* TO 'fast'@'%'
REQUIRE NONE
WITH MAX_QUERIES_PER_HOUR 0
MAX_CONNECTIONS_PER_HOUR 0
MAX_UPDATES_PER_HOUR 0
MAX_USER_CONNECTIONS 0;
CREATE DATABASE IF NOT EXISTS `fast`;
GRANT ALL PRIVILEGES ON `fast`.* TO 'fast'@'%';
GRANT ALL PRIVILEGES ON `fast\_%`.* TO 'fast'@'%';
CREATE USER 'fast'@'%'
IDENTIFIED WITH mysql_native_password AS '***';
GRANT USAGE ON *.* TO 'fast'@'%'
REQUIRE NONE
WITH MAX_QUERIES_PER_HOUR 0
MAX_CONNECTIONS_PER_HOUR 0
MAX_UPDATES_PER_HOUR 0
MAX_USER_CONNECTIONS 0;
CREATE DATABASE IF NOT EXISTS `fast`;
GRANT ALL PRIVILEGES ON `fast`.* TO 'fast'@'%';
GRANT ALL PRIVILEGES ON `fast\_%`.* TO 'fast'@'%';
If unique favicon is available only via chrome extension. You can grab it:
chrome://favicon/size/48/http://localhost
If unique favicon is available only via chrome extension. You can grab it:
chrome://favicon/size/48/http://localhost
// check if expired
Carbon::parse($createdAt)->addSeconds($this->expires)->isPast();
// diff in seconds
$then = Carbon::now()->addMinute();
$now = Carbon::now();
$then->diffInSeconds($now, false) // -60
$now->diffInSeconds($then, false) // 60
// check if expired
Carbon::parse($createdAt)->addSeconds($this->expires)->isPast();
// diff in seconds
$then = Carbon::now()->addMinute();
$now = Carbon::now();
$then->diffInSeconds($now, false) // -60
$now->diffInSeconds($then, false) // 60
// parse string
let will_end = '2019-02-01 10:00:00';
let then = moment(new Date(will_end));
// diff in seconds
let then = moment().add(1, 'minute');
let now = moment();
then.diff(now, 'seconds'); // 60
now.diff(then, 'seconds'); // -60
sudo subl /etc/php/7.1/cli/php.ini
sudo subl /etc/php/7.1/fpm/php.ini
[Xdebug]
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_handler="dbgp"
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.idekey="PHPSTORM"
sudo subl /etc/php/7.1/cli/php.ini
sudo subl /etc/php/7.1/fpm/php.ini
[Xdebug]
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_handler="dbgp"
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.idekey="PHPSTORM"
xdebug.overload_var_dump=off
a. Right click on an entry in the network log. Then select Copy All as HAR
b. In console:
”`js x = [<>]; // paste here copied HAR
(function(logObj, mime) {
var results = [];
logObj[0].log.entries.forEach(function (entry) {
if (mime && entry.response.content.mimeType !== mime) return;
results.push(entry.request.url);
a. Right click on an entry in the network log. Then select Copy All as HAR
b. In console:
”`js x = [<>]; // paste here copied HAR
(function(logObj, mime) {
var results = [];
logObj[0].log.entries.forEach(function (entry) {
if (mime && entry.response.content.mimeType !== mime) return;
results.push(entry.request.url);
});
console.log(results.join('\n'));
})(x, 'image/png'); // can be changed type
”`
c. Save links in file
d. wget -i file
Cheatsheet
Preventing easy:
<a href="#" @click.prevent="toDo();"></a>
Easy event handling:
Cheatsheet
Preventing easy:
<a href="#" @click.prevent="toDo();"></a>
Easy event handling:
<button @click.ctrl="onClick">A</button>
<button @click.ctrl.exact="onCtrlClick">A</button>
Prop validation:
Vue.component('example', {
props: {
// basic type check (`null` means accept any type)
propA: Number,
// multiple possible types
propB: [String, Number],
// a required string
propC: {
type: String,
required: true
},
// a number with default value
propD: {
type: Number,
default: 100
},
// object/array defaults should be returned from a
// factory function
propE: {
type: Object,
default: function () {
return { message: 'hello' }
}
},
// custom validator function
propF: {
validator: function (value) {
return value > 10
}
}
}
})
Mixins:
require('myapp-bootstrap');
require('./components/bootstrap');
var app = new Vue({
mixins: [require('myapp')]
});
module.exports = {
el: '#myapp-app',
/**
* The application's data.
*/
data: {
},
}
module.exports = {
/**
* Load mixins for the component.
*/
mixins: [
require('./../mixins/one'),
require('./../mixins/two'),
require('./../mixins/three')
],
}
// mixins/one.js
module.exports = {
data: {
},
}
this.$nextTick(function () {
if(!this.paperdoll){
const Paperdoll = Vue.extend(require('./../Paperdoll.vue'));
new Paperdoll({
propsData: {
nativeUser: this.user,
nativeItems: this.items,
}
}).$mount('#open-' + this.user.id);
}
});
Cut table from dump:
sed -n -e '/CREATE TABLE.*`mytable`/,/CREATE TABLE/p' mysql.dump > mytable.dump
Cut table from dump:
sed -n -e '/CREATE TABLE.*`mytable`/,/CREATE TABLE/p' mysql.dump > mytable.dump