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
// Query arguments | |
$popular_args = array( | |
'posts_per_page' => $size, | |
'meta_key' => '_base_popular_posts_count', | |
'orderby' => 'meta_value_num' | |
'year' => date('Y'), // Current year | |
'monthnum' => date('n') // Current month | |
); |
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
// sending to sender-client only | |
socket.emit('message', "this is a test"); | |
// sending to all clients, include sender | |
io.emit('message', "this is a test"); | |
// sending to all clients except sender | |
socket.broadcast.emit('message', "this is a test"); | |
// sending to all clients in 'game' room(channel) except sender |
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 | |
// === Eloquent Model Filter Function === // | |
private function filters($query, $request) | |
{ | |
if ($request->has('user')) { | |
$query->where('user_id', $request->get('user'))->whereNotNull('text'); | |
//profile - show all except responses without text | |
} else { |
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
#!/bin/bash | |
# version 1.2 | |
### changelog: first ask whether it's a laravel project or not. | |
# to be able to work this function globally, copy or create link in /usr/local/bin with execute permission (chmod +x) | |
## Process | |
# 1. cp .env.example .env | |
# 2. composer install | |
# 3. php artisan key:generate |