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
import discord | |
from discord.ext import commands | |
import requests | |
import json | |
# Create a bot instance with a command prefix | |
bot = commands.Bot(command_prefix='!') | |
# WordPress credentials | |
WORDPRESS_URL = 'https://yourwordpresssite.com/wp-json/wp/v2/posts' |
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
{ | |
"name": "my/mysite", | |
"type": "project", | |
"authors": [ | |
{ | |
"name": "My Name", | |
"email": "[email protected]" | |
} | |
], | |
"require": { |
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
this is a haggling simulator where I am trying to buy any secondhand car and you have the role of the car salesman. the car is values at a certain price which is stated up front. Your aim is to try and get as close to the target price, you get paid by commision which is the typical percentage of the agreed price, which is your score. my goal is to pay as little as possible, anything less than the target price is my score. Every time we play the car is generated again, with a new target price, and new characteristics. There are additional characteristcs of the car and its condition that are not mentioned that can be uncovered by an inspection, that you are aware of. All characteristics are revealed at the end of the game. You, the salesman, use typical car sales techniques to convince me to buy the car at your desired price. I try and use typical car buyer techniques to bring the price down. We take turns making arguments pro and con. Are you ready? When you are ready, generate a car with visible characteristi |
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 | |
// Read the contents of the log file into an array | |
$log_file = 'web1_php_errors.log'; | |
$log_entries = file($log_file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); | |
// Filter log entries for the last 14 days | |
$current_date = new DateTime(); | |
$filtered_entries = array_filter($log_entries, function($entry) use ($current_date) { | |
// Extract the date part and convert it to a DateTime object | |
$entry_date_str = substr($entry, 1, 20); // Extracting the date part |
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 | |
/** | |
* `favicon.php` - Dynamically generate a favicon image with background color and text overlay | |
*/ | |
$fallback = 'favicon.ico'; | |
if ( file_exists( $fallback ) ) { | |
// use a favicon.ico if available | |
header( "Location: $fallback" ); | |
die( "Redirecting to $fallback" ); |
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 | |
register_shutdown_function('handleShutdown'); | |
function handleShutdown() { | |
$lastError = error_get_last(); | |
if (null !== $lastError) { | |
switch ($lastError['type']) { | |
case E_ERROR: | |
case E_PARSE: |
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
#!/bin/bash | |
# Variables to set the starting position and increment. | |
xPos=60 | |
yPos=60 | |
increment=30 | |
# Save the active window id for later. | |
active_window_id=$(xdotool getactivewindow) | |
active_window_id_hex=$(printf "0x%08x" "$active_window_id") |
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
/** | |
* Returns the first element that matches the specified CSS selector within the document. | |
* | |
* @function $ | |
* @param {string} selector - The CSS selector used to select the element. | |
* @returns {Element|null} The first element that matches the selector, or null if no elements are found. | |
*/ | |
let $ = document.querySelector.bind(document); | |
/** |
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
#!/usr/bin/env bash | |
# Requirements | |
if ! command -v docker &> /dev/null; then | |
echo 'Please install docker: https://docs.docker.com/engine/install/' | |
exit 1 | |
fi | |
if ! command -v ngrok &> /dev/null; then | |
echo 'Please install ngrok: https://ngrok.com/download' |
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
.tri-layout-container .tri-layout-middle { | |
padding-top: 0 !important; | |
} | |
.content-wrap.card { | |
padding: 4px 16px !important; | |
} | |
.content-wrap.card h2 { | |
font-size: 1.25rem !important; | |
} | |
.tri-layout-left-contents, .tri-layout-right-contents { |
NewerOlder