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
class FriendshipRepository implements Contract { | |
public function countAccepted($user) { | |
$user = $user instanceof User ? $user->id : $user; | |
return $this->model->where('user_id', $user) | |
->where('status', 'accepted') | |
->count(); | |
} | |
} |
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
{ | |
"private": true, | |
"devDependencies": { | |
"dotenv": "^2.0.0", | |
"gulp": "^3.8.8", | |
"gulp-clean": "^0.3.1", | |
"gulp-exec": "^2.1.2", | |
"gulp-file": "^0.2.0", | |
"gulp-filter": "^4.0.0", | |
"gulp-html-replace": "^1.5.4", |
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
#!/bin/bash | |
# | |
# supervisor Start/Stop the supervisor daemon. | |
# | |
# chkconfig: 345 90 10 | |
# description: Supervisor is a client/server system that allows its users to | |
# monitor and control a number of processes on UNIX-like operating | |
# systems. | |
. /etc/init.d/functions |
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
class ScrollMonitor extends React.Component { | |
constructor() { | |
this.handleScrollStart = this.startWatching.bind( this ); | |
this.handleScrollEnd = debounce( | |
this.stopWatching.bind( this ), | |
100, | |
{ leading: false, trailing: true } ); | |
} | |
componentDidMount() { |
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
homestead() { | |
VAGRANT_CWD=$HOME/Homestead vagrant $@ | |
} |
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
defmodule Config do | |
@moduledoc """ | |
This module handles fetching values from the config with some additional niceties | |
""" | |
@doc """ | |
Fetches a value from the config, or from the environment if {:system, "VAR"} | |
is provided. | |
An optional default value can be provided if desired. |
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
let x = 0; | |
async function test() { | |
x += await 2; | |
console.log(x); | |
} | |
test(); | |
x += 1; | |
console.log(x); |
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 [ | |
// ... | |
'redis' => [ | |
'options' => [ | |
// Options can be specified here (with the lowest precedence). | |
], |
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 | |
/** | |
* [list_searcheable_acf list all the custom fields we want to include in our search query] | |
* @return [array] [list of custom fields] | |
*/ | |
function list_searcheable_acf(){ | |
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF"); | |
return $list_searcheable_acf; | |
} |
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 | |
namespace App\Support; | |
use App\User; | |
use Illuminate\Database\Eloquent\Model; | |
abstract class CurrentUserAwareModel extends Model | |
{ | |
/** |