Skip to content

Instantly share code, notes, and snippets.

@gmcinnes
gmcinnes / wtf.php
Last active December 13, 2016 23:32
wtf php
<?php
$x = $this->redirected_hostname();
var_dump($x);
var_dump($uri);
$y = $uri . $x;
var_dump($y);
var_dump("wtf");
die();
@gmcinnes
gmcinnes / gist:7468977
Last active December 28, 2015 08:08
Find broken data
column :reason, 4
column :account_id, 5
column :contact_id, 6
column :closed_date, 7
column :total_value_mars_resource_usage, 8
column :total_value_mars_resources, 9
column :last_modified_date, 10
column :eir_case_date, 11
end
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@gmcinnes
gmcinnes / gist:6781756
Last active December 24, 2015 10:09
Careers
<html>
<head>
<title>Careers</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type='text/javascript' src='//www.marsdd.com/wp-content/themes/marsdd-test/js/jquery.ba-postmessage.min.js'></script>
</head>
<body>
@gmcinnes
gmcinnes / gist:6769227
Created September 30, 2013 19:54
Javascript for pipe helper
<script type="text/javascript">
function iframeResizePipe()
{
// What's the page height?
var height = document.body.scrollHeight;
// Going to 'pipe' the data to the parent through the helpframe..
var pipe = document.getElementById('helpframe');
// Get our current location - staging? production? local?
var full = location.protocol+'//'+location.hostname+(location.port ? ':'+location.port: '');
// Cachebuster a precaution here to stop browser caching interfering
@gmcinnes
gmcinnes / gist:6132030
Last active December 20, 2015 12:38
Ideal world
[content]
h1. This is page title
p. This is a bunch of stuff
[/content]
[sidebar]
[box]
h1. Join Ent 101
p. Ent 101 is an awesome program!!!1
LULZ
[/box]
@gmcinnes
gmcinnes / rofo.rb
Last active December 19, 2015 21:48
message :body => /^\/(space)?rofo\s*([\d])*\s*$/ do
phrases = ["Subways, subways, subways!",
"Anything else?",
"I saved a billion dollars.",
"I'm running for mayor in 2014!",
"Gridlock creates pollution. It keeps you away from your families.",
"Cyclists are a pain in the ass.",
"The purpose of marathons is to create revenue for charities.",
"I stopped the Gravy Train!"
]
$result = $this->execute("SELECT * FROM wp_postmeta WHERE meta_key LIKE '_meta_box_id_application_date'");
if($result)
{
foreach($result as $row)
{
$type = gettype($row['meta_value']);
switch($type)
case 'string':
$date = date_from_string($row['meta_value']);
# backupninja
# /var/log/backupninja.log
#
$InputFileName /var/log/backupninja.log
$InputFileTag backupninja
$InputFileStateFile state_file_backupninja_backupninja
#$InputFileSeverity error
$InputFileFacility local7
$InputRunFileMonitor
$InputFilePollInterval 10
@gmcinnes
gmcinnes / core.rb
Last active December 16, 2015 12:49
Simplify?
module Model
module Core
include ExtensionLadder
end
end