Skip to content

Instantly share code, notes, and snippets.

View DaveRandom's full-sized avatar

Chris Wright DaveRandom

View GitHub Profile
// ==UserScript==
// @name Bah humbug
// @description Disable the php.net 2014-04-01 scripts
// @version 1.0
// @author DaveRandom
// @namespace https://github.com/DaveRandom
// @match *://php.net/*
// @match *://*.php.net/*
// ==/UserScript==
@DaveRandom
DaveRandom / keybase.md
Created September 18, 2014 10:18
Verifying keybase identity

Keybase proof

I hereby claim:

  • I am DaveRandom on github.
  • I am daverandom (https://keybase.io/daverandom) on keybase.
  • I have a public key whose fingerprint is 041D 03AE C3A0 4031 AEB8 5363 1618 4931 222E AD5B

To claim this, I am signing this object:

@DaveRandom
DaveRandom / oadate.php
Last active July 19, 2017 07:53 — forked from seanbamforth/oadate.php
PHP OADate formatting - To and From...
<?php
class OLEAutomationDateConverter
{
/**
* Get the OLE Automation Date epoch
*
* @return DateTimeImmutable
*/
public static function BaseDate()
<?php
//echo dirname(__FILE__);
$curl = curl_init('https://mydomain.com/');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_NOBODY, true);
curl_setopt($curl, CURLOPT_CERTINFO, true);
curl_setopt($curl, CURLOPT_VERBOSE, 1);
curl_setopt($curl, CURLOPT_STDERR, fopen('php://output', 'w'));
@DaveRandom
DaveRandom / .gitignore
Created August 2, 2016 10:07
Default repository layout - PHP web application
vendor # ignore composer data
# ignore PHP Storm config
# you may want to ignore your IDE config and you may want to commit it, up to you
.idea
array(97) { ["PROCESSOR_ARCHITEW6432"]=> string(5) "AMD64" ["_FCGI_X_PIPE_"]=> string(53) "\\.\pipe\IISFCGI-c9b24bea-eef1-4a1d-b0a5-a94ab18c4deb" ["PHP_FCGI_MAX_REQUESTS"]=> string(5) "10000" ["PHPRC"]=> string(31) "C:\Program Files (x86)\PHP\v5.3" ["ALLUSERSPROFILE"]=> string(14) "C:\ProgramData" ["APPDATA"]=> string(56) "C:\Windows\system32\config\systemprofile\AppData\Roaming" ["APP_POOL_CONFIG"]=> string(51) "C:\inetpub\temp\apppools\SingleRTB\SingleRTB.config" ["APP_POOL_ID"]=> string(9) "SingleRTB" ["CommonProgramFiles"]=> string(35) "C:\Program Files (x86)\Common Files" ["CommonProgramFiles(x86)"]=> string(35) "C:\Program Files (x86)\Common Files" ["CommonProgramW6432"]=> string(29) "C:\Program Files\Common Files" ["COMPUTERNAME"]=> string(15) "WIN-IAHBJGOU4S1" ["ComSpec"]=> string(27) "C:\Windows\system32\cmd.exe" ["FP_NO_HOST_CHECK"]=> string(2) "NO" ["JRE_HOME"]=> string(32) "C:\Program Files (x86)\Java\jre7" ["LOCALAPPDATA"]=> string(54) "C:\Windows\system32\config\systemprofile\AppData\Local" ["NU
@DaveRandom
DaveRandom / client.php
Last active September 9, 2021 19:58 — forked from ikariiin/server.php
<?php declare(strict_types = 1);
function send_data($socket, $data)
{
echo "Sending data {$data}\n";
fwrite($socket, $data);
$response = fread($socket, 1024);
echo "Got response: {$response}\n";
}
@DaveRandom
DaveRandom / Draytek Google Domains DDNS Dynamic DNS Config.md
Last active March 11, 2023 01:41
Draytek Google Domains DDNS Dynamic DNS Config

How to configure a Draytek router to update your dynamic DNS record with Google Domains

Draytek Dynamic DNS Configuration Page

  1. Choose the "WAN Interface" strategy to use when determining the IP address used when performing updates.
  2. In the "Service Provider" field, choose "User Defined". Additional configuration fields appear.
  3. In the "Provider Host" field, enter domains.google.com
  4. In the "Service API" field, enter /nic/update?myip=###IP###&hostname=your.hostname.here, replacing "your.hostname.here" with the fully qualified name of the record you wish to dynamically update.
  5. In the "Auth Type" field, choose "Basic" (this is the default).
  6. In the "Connection Type" field, choose "HTTPS".
@DaveRandom
DaveRandom / script.js
Last active June 6, 2018 09:36
Tweet icon for Jeeves in SO chat
// ==UserScript==
// @name Tweet icon for Jeeves in SO chat
// @namespace http://room11.org/
// @version 1.0
// @description @PeeHaa sucks
// @author @DaveRandom
// @match *://chat.stackoverflow.com/rooms/*
// @grant none
// ==/UserScript==
@DaveRandom
DaveRandom / readme.md
Last active July 21, 2017 11:16
Adding projects to OpenGrok on lxr.room11.org

Adding projects to OpenGrok on lxr.room11.org

Connecting to the server

SSH to lxr.room11.org. The server requires public key authentication, contact a room owner to have your key added.

Adding a project

Check out the sources from git into /srv/sources. The directory name will appear in the OpenGrok web interface, so choose a sensible directory name! Please use https:// URLs for the remote where possible.