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);
@kevbradwick
kevbradwick / gist:8438857
Created January 15, 2014 16:00
Image function
Image = function() {
return document.createElement('img');
}
@kevbradwick
kevbradwick / gist:7911039
Created December 11, 2013 14:11
Locations API call in Go
package main
import (
"encoding/xml"
"flag"
"fmt"
"io/ioutil"
"net/http"
"strings"
)
@kevbradwick
kevbradwick / gist:6573295
Created September 15, 2013 18:39
Tizen Contacts API - Emulator/Simulator bug
(function() {
var data = [
new tizen.Contact({
name: new tizen.ContactName({firstName: "Tim", lastName: "Berners-Lee"}),
emails: [new tizen.ContactEmailAddress("tim@example.com")],
phoneNumbers: [{number: '01234567890', types: ['home']}]
}),
new tizen.Contact({
name: new tizen.ContactName({firstName: "Brendan", lastName: "Eich"}),
@kevbradwick
kevbradwick / gist:5467928
Created April 26, 2013 14:59
is_bool_lying?
<?php
var_dump(is_bool(false));
// returns "boolean true"
@kevbradwick
kevbradwick / gist:3290047
Created August 7, 2012 22:27
Order results by distance in PostGIS
SELECT
//.. columns
ST_Distance(
<column_name>::geometry,
ST_GeomFromText('SRID=4326;POINT(-3.3305 51.67256)') /* Known Lon/Lat */
) as distance
FROM <table_name>
ORDER BY distance ASC