Skip to content

Instantly share code, notes, and snippets.

View kevbradwick's full-sized avatar

Kevin Bradwick kevbradwick

  • South Wales, UK
View GitHub Profile
@kevbradwick
kevbradwick / Prediction.csv
Created January 14, 2023 15:47
used car sales machine learning
index year mileage actual_value prediction difference
0 2020 14257 19599 18985.741318662185 613.2586813378148
1 2014 120000 8490 8251.234411271987 238.76558872801252
@kevbradwick
kevbradwick / api.conf
Last active March 25, 2020 04:24
Reverse proxy to host using Docker
upstream api-app {
server host.docker.internal:8000;
}
server {
listen 80;
listen [::]:80;
server_name api-app.localhost;
@kevbradwick
kevbradwick / IntelIJTrialReset.bat
Created November 15, 2018 20:38
How to Reset InteIIiJ IDEA Evaluation Key in Windows
cd "C:%HOMEPATH%\.IntelliJIdea*\config"
rmdir "eval" /s /q
del "options\options.xml"
reg delete "HKEY_CURRENT_USER\Software\JavaSoft\Prefs\jetbrains\idea" /f
:: It is Highly Advised to Purchase the JetBrain Softwares
:: This is only for the case You just want to Extend the
:: Trial Period and Evaluate the IDE for some more Time

Keybase proof

I hereby claim:

  • I am kevbradwick on github.
  • I am kevbradwick (https://keybase.io/kevbradwick) on keybase.
  • I have a public key whose fingerprint is 8B13 3731 7BEF D22A 191A E33F 80B9 3525 EC33 1A85

To claim this, I am signing this object:

@kevbradwick
kevbradwick / gist:fc820c6aa8813636c74c
Last active February 4, 2016 13:22
cookie split to object
var cookies = {};
document.cookie.split('; ').forEach(function(pair) {
var parts = pair.split('=');
cookies[parts[0]] = parts.splice(1).join('=');
});
console.log(cookies);
package uk.co.bbc.naturewatch;
import android.os.Bundle;
import android.view.View;
import com.google.android.glass.app.Card;
import com.google.android.glass.widget.CardBuilder;
import uk.co.bbc.naturewatch.tasks.Task;
import uk.co.bbc.naturewatch.tasks.TaskList;
import java.util.ArrayList;
var i18n = new Translations("en");
i18n.get('search.prompt');
i18n.setLanguage("cy");
i18n.get('search.prompt');
@kevbradwick
kevbradwick / gist:9413873
Last active August 29, 2015 13:57
quick csv2json example
#!/usr/bin/env python
"""
Usage: cat mycsvfile.csv | ./csv2json.py > myjson.json
"""
import fileinput
import json
rows = []
headers = []
first_row = True
@kevbradwick
kevbradwick / gist:9073945
Created February 18, 2014 16:09
novel way of ie6 detection that doesn't rely on user agent sniffing
/**
* Property: mapTypes
* The types of map we're switching between
*/
mapTypes: (function() {
var div = document.createElement('div');
div.innerHTML = '<!--[if lte IE 6]><i></i><![endif]-->';
if (!!div.getElementsByTagName('i').length) {
@kevbradwick
kevbradwick / gist:8438857
Created January 15, 2014 16:00
Image function
Image = function() {
return document.createElement('img');
}