Skip to content

Instantly share code, notes, and snippets.

View bih's full-sized avatar
😄

Bilawal Hameed bih

😄
View GitHub Profile
@bih
bih / embed_in_console.js
Last active January 3, 2016 17:00
Calculate how much you've paid to Spotify
// Go to https://www.spotify.com/account/subscription/receipt/
var Receipt = function(jquery){
this.id = $(jquery).find(".receipt-orderid").text();
this.id = $.trim(this.id);
this.id = parseInt(this.id);
this.date = $(jquery).find(".receipt-date").text();
this.date = new Date(Date.parse(this.date));
@bih
bih / test_data.json
Created December 23, 2013 00:56
Test data for iPhone app
[{"longitude":-82.965972900391,"latitude":35.090648651123,"title":"Rainbow Falls","subtitle":"Nantahala National Forest"},{"longitude":-82.966093558105,"latitude":35.092520895652,"title":"Turtleback Falls","subtitle":"Nantahala National Forest"},{"longitude":-82.95916,"latitude":35.07496,"title":"Windy Falls"}]
@bih
bih / .bash_profile
Last active December 28, 2015 11:19
function r() {
# Use dot notation for file structure
# "app.assets.stylesheets" == "app/assets/stylesheets"
REPLACE="/"
INPUT="."$1
INPUT=${INPUT//./$REPLACE}
# No longer need to prepend with /
REPLACE="/"
INPUT=${INPUT//\//$REPLACE}
@bih
bih / getMonthName.extend.js
Created October 21, 2013 15:12
Simple function in JavaScript to getMonthName() :-)
Date.prototype.getMonthName = function(){
return ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"][this.getMonth()];
};
@bih
bih / gtlds.json
Created March 23, 2013 13:04
New gTLD's as json
["AAA","AARP","ABARTH","ABB","ABBOTT","ABBVIE","ABC","ABLE","ABOGADO","ABUDHABI","ACADEMY","ACCENTURE","ACCOUNTANT","ACCOUNTANTS","ACER","ACO","ACTIVE","ACTOR","ADAC","ADS","ADULT","AEG","AETNA","AFAMILYCOMPANY","AFL","AFRICA","AFRICAMAGIC","AGAKHAN","AGENCY","AIG","AIGO","AIRBUS","AIRFORCE","AIRTEL","AKDN","ALCON","ALFAROMEO","ALIBABA","ALIPAY","ALLFINANZ","ALLFINANZBERATER","ALLFINANZBERATUNG","ALLSTATE","ALLY","ALSACE","ALSTOM","AMAZON","AMERICANEXPRESS","AMERICANFAMILY","AMEX","AMFAM","AMICA","AMP","AMSTERDAM","ANALYTICS","AND","ANDROID","ANQUAN","ANSONS","ANTHEM","ANTIVIRUS","ANZ","AOL","APARTMENTS","APP","APPLE","AQUARELLE","AQUITAINE","ARAB","ARAMCO","ARCHI","ARCHITECT","ARE","ARMY","ART","ARTE","ASDA","ASSOCIATES","ASTRIUM","ATHLETA","ATTORNEY","AUCTION","AUDI","AUDIBLE","AUDIO","AUSPOST","AUTHOR","AUTO","AUTOINSURANCE","AUTOS","AVERY","AVIANCA","AWS","AXA","AXIS","AZURE","BABY","BAIDU","BANAMEX","BANANAREPUBLIC","BAND","BANK","BANQUE","BAR","BARCELONA","BARCLAYCARD","BARCLAYS","BAREFOOT","BARGAINS","
@bih
bih / atms.json
Created March 23, 2013 12:59
ATM's in Manchester (accurate as of 23rd March 2013)
[{"name":"Atherton","address":["116-118 Market Street","Manchester","Lancashire","M46 0NS"],"address_single":"116-118 Market Street, Manchester, Lancashire, M46 0NS","lng":53.523286,"lat":-2.495392},{"name":"Barnes Green","address":["Lee Road","Manchester","Lancashire","M9 4DL"],"address_single":"Lee Road, Manchester, Lancashire, M9 4DL","lng":53.512915,"lat":-2.213129},{"name":"Burnage Lane","address":["89 Burnage Lane","Manchester","Lancashire","M19 2WN"],"address_single":"89 Burnage Lane, Manchester, Lancashire, M19 2WN","lng":53.436671,"lat":-2.199936},{"name":"Cheetham Hill","address":["6 King Edward Buildings","Manchester","Greater Manchester","M7 4QJ"],"address_single":"6 King Edward Buildings, Manchester, Greater Manchester, M7 4QJ","lng":53.513534,"lat":-2.246564},{"name":"Chorlton-Cum-Hardy","address":["543 Wilbraham Road","Manchester","Lancashire","M21 9PP"],"address_single":"543 Wilbraham Road, Manchester, Lancashire, M21 9PP","lng":53.442192,"lat":-2.275356},{"name":"Crofts Bank","address":["12 L
(function($){
function dragEnter(e) {
$(e.target).addClass("dragOver");
e.stopPropagation();
e.preventDefault();
return false;
};
function dragOver(e) {
e.originalEvent.dataTransfer.dropEffect = "copy";
@bih
bih / Bilawal-Preloader.html
Created July 30, 2012 00:09
Bilaw.al Preloader
<!doctype html>
<head>
<title>Bilaw.al Loader</title>
<!-- Produced by @bilawalhameed -->
<!-- tha css. kthxbai. -->
<style type="text/css">
#bilawal-loading {
position: relative;
width: 112px;
@bih
bih / Cheddar-loader.html
Created July 28, 2012 19:00
A simple gist of a Cheddar-logo HTML/CSS/JS logo loader effect. Boredom was a big part of this gist fruition. It is a bit 'hacky' like, so I wouldn't recommend it in production.
<!doctype html>
<head>
<title>Cheddar Loader</title>
<!-- Produced by @bilawalhameed -->
<!-- tha css. kthxbai. -->
<style type="text/css">
#cheddar-loading {
position: relative;
width: 539px;
@bih
bih / london_cities.json
Created June 11, 2012 15:38
Here's a JSON file of all the inner cities within London. I compiled it when using it for a project.
["Abbey Wood","Acton","Aldwych","Archway","Barking","Barkingside","Barnes","Battersea","Bayswater","Beckenham","Beckton","Belgravia","Belvedere","Bermondsey","Bethnal Green","Biggin Hill","Blackfen","Blackheath","Bloomsbury","Bounds Green","Bow","Brixton","Brockley","Bromley","Brompton","Burnt Oak","Camberwell","Camden","Carshalton Beeches","Catford","Central London","Chelsea","Chingford","Chislehurst","Chiswick","Clapham","Cockfosters","Colindale","Colliers Wood","Cricklewood","Crouch End","Croydon","Crystal Palace","Deptford","Docklands","Ealing","East Dulwich","Edmonton","Elephant & Castle","Eltham","Erith","Euston","Finchley","Finsbury Park","Forest Hill","Fulham","Golders Green","Greenwich","Hackney","Hammersmith","Hampstead","Harlesden","Harold Hill","Harringay","Heathrow Airport","Hendon","Herne Hill","Heston","Highbury","Highgate","Holloway","Honor Oak Park","Hook","Hornchurch","Hornsey","Ickenham","Islington","Kennington","Kensal Rise","Kensington","Kentish Town","Kidbrooke","Kilburn","Lee","Lewisham