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 | |
function premiumUsers($users) | |
{ | |
return array_filter($users, "userTypeIsPremium"); | |
} | |
function userTypeIsPremium($user) { | |
return $user->type = USER_TYPE_PREMIUM; | |
} |
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 | |
function premiumUsers($users) | |
{ | |
$premiumUsers = []; | |
foreach ($users as $user) { | |
if ($user->type === USER_TYPE_PREMIUM) { | |
$premiumUsers[] = $user; | |
} | |
} |
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
<scheme name="_@user_Atom One Dark" version="142" parent_scheme="Darcula"> | |
<option name="FONT_SCALE" value="1.0" /> | |
<metaInfo> | |
<property name="created">2018-03-23T15:28:07</property> | |
<property name="ide">PhpStorm</property> | |
<property name="ideVersion">2017.3.6.0.0</property> | |
<property name="modified">2018-03-23T15:34:31</property> | |
<property name="originalScheme">Atom One Dark</property> | |
</metaInfo> | |
<option name="LINE_SPACING" value="1.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
rm routes/botman.php && wget https://raw.githubusercontent.com/botman/studio/master/routes/botman.php -P routes/ && rm app/Http/Controllers/BotManController.php && wget https://raw.githubusercontent.com/botman/studio/master/app/Http/Controllers/BotManController.php -P app/Http/Controllers/; rm app/Conversations/ExampleConversation.php; wget https://raw.githubusercontent.com/botman/studio/master/app/Conversations/ExampleConversation.php -P app/Conversations/ |
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
# v2 syntax | |
version: '2' | |
volumes: | |
# MySQL Data | |
subnet-mysql-data: | |
driver: local | |
# Redis Data | |
subnet-redis-data: |
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
<scheme name="Mark Material Theme Dark" version="142" parent_scheme="Default"> | |
<option name="FONT_SCALE" value="1.0" /> | |
<metaInfo> | |
<property name="created">2017-04-07T02:25:41</property> | |
<property name="ide">PhpStorm</property> | |
<property name="ideVersion">2017.1.1.0.0</property> | |
<property name="modified">2017-09-19T22:34:18</property> | |
<property name="originalScheme">Material Theme - Darker</property> | |
</metaInfo> | |
<option name="LINE_SPACING" value="1.6" /> |
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 | |
protected function debug($data) | |
{ | |
$fileName = "/home/mfurtado/mark.txt"; | |
$content = file_get_contents($fileName); | |
$newContent = $content . "------------\n".json_encode($data)."\n------------\n"; | |
file_put_contents($fileName, $newContent); | |
} |
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 | |
$search = isset($_GET['search']) ? trim($_GET['search']) : null; | |
if ($search) { | |
$posts = new WP_Query([ | |
's' = $search, | |
'post_type' => 'downloads' | |
]); | |
} |
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 | |
public function store(Request $request) | |
{ | |
$comment = $this->createComment($request->all()); | |
$this->highlightCommentOnUser( $request->get('user_id'), $comment); | |
$this->notifyUsersInteractedWithPost($comment->post); | |
return ['success' => true]; |
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 | |
public function store(Request $request) | |
{ | |
// Create a new comment | |
$comment = Comment::create($request->all()); | |
// Find the author and highlight the comment on your profile | |
$user = User::find( $request->get('user_id') ); | |
$user->profile->highlightNewComment($comment); |