Skip to content

Instantly share code, notes, and snippets.

# This xorg configuration file will start a dummy X11 server.
# move it to /etc/X11/xorg.conf
# don't forget apt install xserver-xorg-video-dummy;
# based on https://xpra.org/Xdummy.html
Section "ServerFlags"
Option "DontVTSwitch" "true"
Option "AllowMouseOpenFail" "true"
Option "PciForceNone" "true"
Option "AutoEnableDevices" "false"
@johnsreid
johnsreid / Chatbot notes.md
Last active September 24, 2018 10:30
Some Chatbot things
Option Explicit
Dim shopArr(38)
shopArr(0) = 50
shopArr(1) = 50
shopArr(2) = 50
shopArr(3) = 50
shopArr(4) = 50
shopArr(5) = 50
shopArr(6) = 50
csplit activity.csv '/^114222,/' '{*}'
@johnsreid
johnsreid / checklink.php
Last active October 19, 2015 13:29
PHP find broken links
Date.prototype.stdTimezoneOffset = function() {
var jan = new Date(this.getFullYear(), 0, 1);
var jul = new Date(this.getFullYear(), 6, 1);
return Math.max(jan.getTimezoneOffset(), jul.getTimezoneOffset());
}
Date.prototype.dst = function() {
return this.getTimezoneOffset() < this.stdTimezoneOffset();
}
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "#542988",
"@brand-success": "#5cb85c",
@johnsreid
johnsreid / check.php
Last active August 29, 2015 14:05
External file check to see if you are subscribed to a WordPress Multisite blog
<?php
$path = '.';
require "$path/wp-blog-header.php";
$current_blog = 1;
$nosite_message = 'You are not subscribed to this site';
$nouser_message = 'You are not signed into this site';
if (is_user_logged_in()) {
if ( !current_user_can_for_blog($current_blog, 'read' ) ) {
@johnsreid
johnsreid / style-gigpress.css
Created July 8, 2014 12:31
A GigPress CSS file that works a little better than the provided Soundcheck CSS file
.button {
color: #bec4cc;
font-size: 12px;
padding: 4px 10px;
background-color: #3f434a;
text-transform: uppercase;
}
.button:hover {
color: #ffffff;
border: none !important;
<?php
add_filter("the_content", "the_content_filter");
function the_content_filter($content) {
// array of custom shortcodes requiring the fix
$block = join("|",array("col","shortcode2","shortcode3"));
// opening tag