Skip to content

Instantly share code, notes, and snippets.

View withinboredom's full-sized avatar
🏠
Working from home

Rob Landers withinboredom

🏠
Working from home
View GitHub Profile
@withinboredom
withinboredom / benchmark.html
Last active August 29, 2015 14:22
boomquery benchmark
<html>
<head>
<style>
.lg {
background-color: blue;
height: 20px;
display: inline-block;
border: 1px solid black;
}
.sm {
@withinboredom
withinboredom / proc.php
Last active October 14, 2015 19:57
processes in php
<?php
while (count($standby) > 0) {
if (count($running) < $threads_per_second - 1) {
$item = array_shift($standby);
if ($item['attempts'] < $item_attempts) {
array_unshift($running, $item);
$spawned++;
echo "Processing " . ++$this->total_count . ": " . $running[0]['code'] . "\n";
//spawn off a child
function getAgents() {
getIp "nginx"
echo "$dockerip www.thecassinagroup.dev" >> /etc/hosts
retry=10
while [ true ]
do
retry=$(expr $retry - 1)
if [ "$retry" == "0" ]
then
echo "Unable to get agent subdomains, this might be a missing or incorrect hosts entry"
@withinboredom
withinboredom / deploy-meteor-azure.ps1
Created November 26, 2015 02:43
Deploy meteor app to Azure Website.
# --------------------------
# Leadbox Meteor deployment script for Azure
# by kellerman@leadbox.ca
# Version: 0.3
# --------------------------
# Please run this script on root folder of your meteor app
# ---------------------------
# Prerequisites:
# --- Visual Studio with C++ installed
# --- Node 0.12.7
echo "hello world"
@withinboredom
withinboredom / pirate.sh
Last active July 19, 2016 13:52
Pi baker
#!/usr/bin/env bash
sudo passwd pirate
sudo apt-get remove -y docker-hypriot docker-compose hypriot-cluster-lab
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install -y nfs-client make
echo "10.0.0.4:/var/nfs /var/nfs nfs auto,noatime,nolock,bg,nfsvers=4 0 0" | sudo tee -a /etc/fstab
sudo mkdir /var/nfs
sudo mount -a
sudo fallocate -l 2G /swapfile
@withinboredom
withinboredom / Dockerfile
Created December 7, 2016 07:17
WordPress plugin
FROM wordpress:4.6.1-php5.6-apache
RUN yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.idekey=bonkers" >> /usr/local/etc/php/conf.d/xdebug.ini
@withinboredom
withinboredom / .config
Created February 21, 2017 17:12
Linux .config
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.9.10-gentoo Kernel Configuration
#
#
# Gentoo Linux
#
CONFIG_GENTOO_LINUX=y
CONFIG_GENTOO_LINUX_UDEV=y
#!/bin/bash
# Slack API token
token="YOUR_TOKEN_HERE"
postMessageUrl="https://slack.com/api/chat.postMessage"
defaultChannel="#SOME_DEFAULT_CHANNEL"
# Was last time "Yesterday"?
echo "Yesterday? Or some other day? (Empty for yesterday)"
read lastTime
@withinboredom
withinboredom / using_hooks.cs
Last active October 23, 2017 16:08
Using WordPress#
using WordPress.Includes;
namespace Example {
class ExampleClass {
public ExampleClass( WpHookManager hooks ) {
hooks.AddAction( "example", Callback, priority: 10, acceptedArgs: 0 );
}
private async Task<object> Callback(IEnumerable<object> args) {
return true;