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 | |
if (isset($_COOKIE['flarum_remember'])) | |
{ | |
$mysql = new mysqli("localhost", "flarum_sql_user", "flarum_sql_pass", "flarum_database"); | |
$result = $mysql->query("SELECT * FROM access_tokens WHERE id = '". $mysql->real_escape_string($_COOKIE['flarum_remember']) ."'"); | |
if ($result->num_rows == 0) | |
{ | |
// Invalid cookie | |
header('Location:https://my.laravel.site/login'); |
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 | |
$api_url = "https://my.flarum.url/api/users/" . $userid; // See: https://gist.github.com/woganmay/4c15a0f7c16e41ab3a3ea1a73c595bf9 | |
$token = $session->token; // See: https://gist.github.com/woganmay/88f15e96fc019657a0e594366403b5cf | |
// This must be a token for a user with Administrator access | |
$ch = curl_init($api_url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 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 | |
$api_url = "https://my.flarum.url/api/users"; | |
$token = $session->token; // See: https://gist.github.com/woganmay/88f15e96fc019657a0e594366403b5cf | |
// This must be a token for a user with Administrator access | |
$new_username = "johnsmith"; | |
$new_password = "password1234"; | |
$new_email = "[email protected]"; |
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 | |
// Details to access Flarum | |
$api_url = "https://my.forum.url/api/token"; | |
$username = "my_flarum_user"; | |
$password = "my_flarum_pass"; | |
// CURL call | |
$ch = curl_init($api_url); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:ListBucket", | |
"s3:ListAllMyBuckets", | |
"s3:GetBucketLocation" | |
], |
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
function twr(transactions, roundingFactor, emv) | |
{ | |
// beginning market value | |
var bmv = 0; | |
// Sort by date | |
transactions.sort(function(a, b){ | |
var da = new Date(a.date); | |
var db = new Date(b.date); |
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\Console\Commands; | |
use Illuminate\Console\Command; | |
use Illuminate\Foundation\Inspiring; | |
class Inspire extends Command | |
{ | |
/** |
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\controllers; | |
use Yii; | |
use yii\filters\AccessControl; | |
use yii\web\Controller; | |
use yii\filters\VerbFilter; | |
use app\models\LoginForm; | |
use app\models\ContactForm; |
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 | |
// http://wogan.me/2016/02/21/get-system-information-in-laravel-5-1/ | |
$linfo = new \Linfo\Linfo; | |
$parser = $linfo->getParser(); | |
$everything = [ | |
'os' => $parser->getOS(), | |
'cpu' => $parser->getCPU(), |