Skip to content

Instantly share code, notes, and snippets.

View fayimora's full-sized avatar
🕺

Fayi FB fayimora

🕺
  • London, England
View GitHub Profile
var appButton = document.getElementById("app-button");
appButton.addEventListener("mouseover",function() {
this.src = "path/to/image";
});
appButton.addEventListener("mouseout",function(){
// return stuff to default
this.src = "path/to/image";
});
public class LocationServiceF extends IntentService {
private static final String TAG = "LocationService";
private Pubnub pubnub;
private Rider currentRider;
public LocationServiceF() {
super("LocationService");
}

Keybase proof

I hereby claim:

  • I am fayimora on github.
  • I am fayimora (https://keybase.io/fayimora) on keybase.
  • I have a public key ASBXT7j-rCkBXSuXqq7czNpnC1yUlpbVtw3YIDwaObF0aAo

To claim this, I am signing this object:

// THIS
$coord = \App\Classes\geoClass::getCoord($request->address1." ".$request->address2, $request->postcode);
// SHOULD BE
$coord = \App\Classes\GeoClass::getCoord($request->address1." ".$request->address2, $request->postcode);
// NOTE: geoClass -> GeoClass
import android.app.Service;
import android.content.Intent;
import android.location.Location;
import android.os.IBinder;
import android.util.Log;
import com.google.android.gms.location.LocationRequest;
import com.pubnub.api.Pubnub;
@fayimora
fayimora / types.md
Created April 19, 2016 11:39
So you want a Type!

So you want a Type!

The Compiler: Avoid Silly Errors

You have probably heard me say this more times than you care to remember but it really cannot be overstated. In python you can initialise a variable, num = 10 and later down the line override that variable like this num = some_complex_func(). Everything looks ok until you try to use that variable. So let's divide that number by a sentinel, sentinel = 3 and result = num/sentinel. On first scan, this looks great but if you take a deeper look, we have no guarantees that some_complex_func() will return a number, talk more of a number with the right type. You deploy your code and it bites you in the ass, AT RUNTIME!

Imagine something like this:

isValid = check_if_valid()
var distance = require('google-distance');
var _ = require('lodash');
module.exports = function (pubnub) {
pubnub.subscribe({
channel: "dispatch",
message: onNewDispatch
});
function onNewDispatch(message) {
module.exports = function(foo) {
function setName(name) {
}
function getName() {
}
// .................
@fayimora
fayimora / London Boroughs Points.kml
Created April 1, 2016 14:31
Process London Boroughs kml files
<?xml version='1.0' encoding='UTF-8'?>
<kml xmlns='http://www.opengis.net/kml/2.2'>
<Document>
<name>London Boroughs Points</name>
<Placemark>
<name>Barking and Dagenham</name>
<description><![CDATA[http://www.lbbd.gov.uk/]]></description>
<styleUrl>#icon-22</styleUrl>
<Point>
<coordinates>0.15559,51.561185,0.0</coordinates>
from bs4 import BeautifulSoup
boutique_names = []
for page in xrange(1, 6):
html_doc = open("asos-boutiques-%d.html" % page).read()
soup = BeautifulSoup(html_doc, 'html.parser')
fieldset = soup.find(id="resultsWrp")
boutique_list = fieldset.findChild(id='boutiqueList')