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();
results = []
xlsx = Roo::Spreadsheet.open('./fund_composition.xlsx')
xlsx.each_with_pagename do |name, sheet|
sheet.each do |row|
row.each do |cell|
results << cell unless results.include? cell
end
end
end
class Car
def init(type_of_car)
@engine = EngineFactory.new(type_of_car)
end
def start
@engine.start
end
def stop
# Ok, we have this situation where there's a tree with duplicate file entries. Look:
± |master ✗| → git fsck
Checking object directories: 100% (256/256), done.
error in tree 8f40c81aa8c7698e3888e74c06c9d0ca5d0e71c9: contains duplicate file entries
Checking objects: 100% (89603/89603), done.
# Unfortunately git gc --aggressive --prune won't get rid of it.
# So lets see where that sha gets referenced in the repo:
*** Sampled system activity (Fri May 9 11:31:29 2014 -0400) (5039.33ms elapsed) ***
*** Running tasks ***
Name PID CPU ms/s User% Deadlines (<2 ms, 2-5 ms) Wakeups (Intr, Pkg idle)
kernel_task 0 2521.27 0.00 0.00 0.20 357.19 143.47
WindowServer 2994 84.54 66.56 7.34 4.56 22.03 13.10
iTerm 40970 68.84 85.52 0.00 0.00 6.15 4.17
Dock 3051 37.93 73.54 0.00 0.00 0.00 0.00
Google Chrome He 23088 27.51 63.77 0.00 0.00 31.95 5.95
@gmcinnes
gmcinnes / gist:9789694
Created March 26, 2014 18:12
keybase.md
### Keybase proof
I hereby claim:
* I am gmcinnes on github.
* I am grantmcinnes (https://keybase.io/grantmcinnes) on keybase.
* I have a public key whose fingerprint is 90E6 0156 C033 384A 66CB F69D 369C 9851 4810 801C
To claim this, I am signing this object:
@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>