Skip to content

Instantly share code, notes, and snippets.

View phpmypython's full-sized avatar

William Wilkerson phpmypython

View GitHub Profile
@phpmypython
phpmypython / 2021_fom_car.xml
Last active July 22, 2022 15:54
These are the xml files defining the values for the multiplayer car in the F1 2022 and 2021 video game for comparison purposes.
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!--BXMLLittle-->
<VTF>
<Engine>
<RevsPowerSpline numVertices="19">
<SplineElement x="0" y="0" op="=" />
<SplineElement x="69.9528" y="9281.2381835937485" op="=" />
<SplineElement x="121.655289" y="23500.66640625" op="=" />
<SplineElement x="176.0811" y="44253.966796875" op="=" />
<SplineElement x="247.059937" y="79293.95546875" op="=" />

To gather this data I used the Ego_ERP_Archiver program and analyzed the XML configuration file for the multiplayer car.

The full XML files for 2021 and 2022 can be found at the following links

For ERS deployment, currently the way it works is that you'll deploy a percentage of the power of the ERS which is 120KW, depending on what ERS mode you're in. The breakdown is as follows:

  • Medium uses 15% (18KW)
  • Hotlap uses 60% (72KW)
@phpmypython
phpmypython / update_content_url.php
Created July 11, 2017 16:36
Update image paths wordpress
function update_content_url()
{
//provide the url and path that you would like used for image uploads.
return 'http://example.com/wp-content/uploads';
}
add_filter('pre_option_upload_url_path', 'update_content_url');
WITH cohort_dfn_by_refr_channel_acquired_by_week AS (
SELECT
domain_userid,
refr_acquired_medium,
week_start
FROM (
SELECT
domain_userid,
refr_medium AS refr_acquired_medium,
DATE_TRUNC('week',collector_tstamp) as week_start,
@phpmypython
phpmypython / blog-header.php
Created April 24, 2016 21:14
Accessing posts page data wordpress
<?php
if ( is_home() && get_option('page_for_posts') )
{
$blog_page_id = get_option('page_for_posts');
$header_image_id = get_field('header_image', $blog_page_id);
$image_id = wp_get_attachment_image_src($header_image_id, 'full');
}
function createDateRangeArray($strDateFrom,$strDateTo)
{
// takes two dates formatted as YYYY-MM-DD and creates an
// inclusive array of the dates between the from and to dates.
// could test validity of dates here but I'm already doing
// that in the main script
$aryRange=array();
(function (m) {
/*
* PHP => moment.js
* Will take a php date format and convert it into a JS format for moment
* http://www.php.net/manual/en/function.date.php
* http://momentjs.com/docs/#/displaying/format/
*/
var formatMap = {
d: 'DD',
D: 'ddd',
openssl req -in ust.csr -inform PEM -out ust.der -outform DER
@phpmypython
phpmypython / utf8_encode.js
Created October 15, 2015 16:39
Implementation of utf8_encode in javascript
//Javascript implementation of utf8_encode function from php.
function utf8_encode(argString) {
if (argString === null || typeof argString === 'undefined') {
return '';
}
var string = (argString + ''); // .replace(/\r\n/g, "\n").replace(/\r/g, "\n");
var utftext = '',
start, end, stringl = 0;
@phpmypython
phpmypython / permissionset.sh
Last active December 24, 2016 06:27
WordPress Permissions
find . -type f -name "wp-config-sample.php" -o -name "readme.html" -o -name "README.txt" -o -wholename "wp-admin/install.php" -exec rm -f {} \; &&
find . -type d -exec chmod 0755 {} \; &&
find . -type f -exec chmod 0755 {} \; &&
find . -name "wp-config.php" -exec chmod 600 {} \;