Skip to content

Instantly share code, notes, and snippets.

@lgladdy
lgladdy / keybase.md
Last active August 29, 2015 13:59
Keybase Proof

Keybase proof

I hereby claim:

  • I am lgladdy on github.
  • I am lgladdy (https://keybase.io/lgladdy) on keybase.
  • I have a public key whose fingerprint is 97AF E3A6 D88B E71E AE80 4117 486F 64CD 35D9 B362

To claim this, I am signing this object:

@lgladdy
lgladdy / banes-ishare.php
Last active May 27, 2018 20:46
BANES Council Data from iShare
$pc = 'ba11be';
//HACKY HACKY. GET the first properly in the postcode.
$url = 'http://isharemaps.bathnes.gov.uk/getdata.aspx?service=LocationSearch&RequestType=LocationSearch&location='.$pc.'&pagesize=1&startnum=1';
$data = json_decode(file_get_contents($url),true);
$x = $data['data'][0][4];
$y = $data['data'][0][5];
$id = $data['data'][0][0];
@lgladdy
lgladdy / quizup.js
Created January 1, 2014 20:10
QuizUp Bookmarklet for profile stats
javascript:(function()%7Bvar%20total%20%3D%20wins%20%3D%20draws%20%3D%20losses%20%3D%200%3Bconsole.log(wins)%3B%24('.wins').each(function()%20%7Bwin%20%3D%20parseInt(%24(this).html())%3Bif%20(isNaN(win))%20return%3Bwins%20%2B%3D%20win%3Btotal%20%2B%3D%20win%3B%7D)%3B%24('.draws').each(function()%20%7Bdraw%20%3D%20parseInt(%24(this).html())%3Bif%20(isNaN(draw))%20return%3Bdraws%20%2B%3D%20draw%3Btotal%20%2B%3D%20draw%3B%7D)%3B%24('.losses').each(function()%20%7Bloss%20%3D%20parseInt(%24(this).html())%3Bif%20(isNaN(loss))%20return%3Blosses%20%2B%3D%20loss%3Btotal%20%2B%3D%20loss%3B%7D)%3Balert(%22Total%20wins%3A%20%22%2Bwins%2B%22%5Cr%5CnTotal%20draws%3A%20%22%2Bdraws%2B%22%5Cr%5CnTotal%20losses%3A%20%22%2Blosses%2B%22%5Cr%5CnTotal%20games%3A%20%22%2Btotal)%7D)()
@lgladdy
lgladdy / bookmarklet.js
Created April 11, 2013 20:03
Comixology Add All Marvel #1 Free Comics Bookmarklet
javascript:(function(){function%20clickAllNextButtons(){jQuery('a').each(function(){if($(this).html()==%22Next%22){cmd=$(this).attr('href').substr(12);eval(cmd);}});}function%20addAllVisible(){var%20changed=0;jQuery('a.addComicLink.normalBtn').each(function(){if($(this).html()==%22Add%20Comic%22){changed++;$(this).click();}});return%20changed;}var%20run=0;addAllVisible();clickAllNextButtons();while(addAllVisible()%3E%200){clickAllNextButtons();}})();
@lgladdy
lgladdy / twitter-application-only-auth.php
Created March 12, 2013 09:46
A working example of Twitter's new application-only auth, written in PHP.
<?php
//This is all you need to configure.
$app_key = '';
$app_token = '';
//These are our constants.
$api_base = 'https://api.twitter.com/';
$bearer_token_creds = base64_encode($app_key.':'.$app_token);