Skip to content

Instantly share code, notes, and snippets.

Grant McInnes gmcinnes

Block or report user

Report or block gmcinnes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View wtf.php
<?php
$x = $this->redirected_hostname();
var_dump($x);
var_dump($uri);
$y = $uri . $x;
var_dump($y);
var_dump("wtf");
die();
View gist:7c9dc30d6c11dae1d0cb
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
View gist:32ee7c24b3ee6b36067a
class Car
def init(type_of_car)
@engine = EngineFactory.new(type_of_car)
end
def start
@engine.start
end
def stop
View gist:62fb765ec09d1c774b52
# 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:
View gist:5324b2024d39b025556a
*** 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
View gist:9789694
### 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 Dec 28, 2015
Find broken data
View gist:7468977
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
View gist:6908318
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
View gist:6781756
<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>
You can’t perform that action at this time.