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
// Data Source: https://nukaknights.com/articles/legendary-mods-all-descriptions-and-usages.html | |
const modWrapperSelector = '.mod_fallout76rewards_legendarymods'; | |
const modData = []; | |
const containers = $(modWrapperSelector); | |
getRankFromRow = function(row) { | |
let parent = $(row).parents(modWrapperSelector)[0]; | |
for (let index = 0; index < containers.length; index++) { | |
if (containers[index] == parent) { | |
return index+1; |
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 | |
declare(strict_types=1); | |
namespace YourApp\Infrastructure\Logging; | |
use Psr\Log\{LoggerInterface, LoggerTrait}; | |
class SlowQueryLogDecorator implements LoggerInterface | |
{ | |
use LoggerTrait; |
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 | |
declare(strict_types=1); | |
namespace Personly\Http\Traits; | |
use Personly\Framework\Rendering\TemplateRenderer; | |
use Symfony\Component\HttpFoundation\{JsonResponse, Response}; | |
trait RendersTemplates |
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 | |
$SQL = "SELECT inv.*, COUNT(*) OVER() AS totalrows FROM stones inv WHERE wt >= 2.5"; | |
if (isset($_POST["ItemSearch"])) $SQL .= "AND number LIKE '" . $_POST["ItemSearch"] . "%'"; | |
if (isset($_POST["minimum_wt"], $_POST["maximum_wt"]) && !empty($_POST["minimum_wt"]) && !empty($_POST["maximum_wt"])) $SQL .= "AND wt BETWEEN '" . $_POST["minimum_wt"] . "' AND '" . $_POST["maximum_wt"] . "'"; | |
if (isset($_POST["shape"])) { |
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 | |
/** | |
* Validates a value based on its length as a string | |
* | |
* ```php | |
* $toBeValidated = 17; | |
* $validationParameters = [ | |
* 'min' => 10 | |
* ]; |
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
// ==UserScript== | |
// @name Trending Now No More | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0 | |
// @description Removes the Trending Now section on Twitter | |
// @author Sean Mumford | |
// @match https://twitter.com/* | |
// @grant none | |
// ==/UserScript== |
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 | |
//FILE LOCATION: project-directory/config/bootstrap.php | |
declare(strict_types=1); | |
//Composer autoloader file | |
require_once __DIR__ . '/../vendor/autoload.php'; | |
error_reporting(E_ALL | E_NOTICE); | |
//Load the files required for configuration | |
$configuration = require __DIR__ . '/settings.php'; | |
$countyList = require __DIR__ . '/../vendor/some-other-package/list-of-tennessee-counties.php'; |
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 | |
/* | |
The question: | |
if ( $date_text == 'Sunday' ){ | |
$sql = "update table set sun = $date where "id ='$_REQUEST[num]"; | |
$sql1= "update table set sun = $date where "id ='$_REQUEST[num1]"; | |
mysql_query($con,$sql); | |
mysql_query($con,$sql1); | |
} |
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 | |
/** | |
* Example of a PHP class that stores dynamic properties in an array, and then can be used to create a SQL statement | |
* | |
* I would consider this a proof-of-concept and I do not believe this is a good practice | |
*/ | |
class User | |
{ | |
/** | |
* @var array Object attributes |
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 | |
namespace App\Tests\Domain\Twitter; | |
use App\Domain\Twitter\TwitterProfile; | |
class TwitterProfileTest extends \App\Tests\BaseUnitTest | |
{ | |
private $accessToken = 'oauth-token'; | |
private $accessSecret = 'oauth-secret'; |
NewerOlder