Skip to content

Instantly share code, notes, and snippets.

View lukesUbuntu's full-sized avatar
🚀
code all day every day & code in my sleep..... zzzz

Luke Hardiman lukesUbuntu

🚀
code all day every day & code in my sleep..... zzzz
View GitHub Profile
@lukesUbuntu
lukesUbuntu / new-zealand-cities-geo.json
Last active March 23, 2020 21:38
New Zealand location geo cities json data
[{
"city": "Auckland",
"latitude": -36.850,
"longitude": 174.760
},
{
"city": "Manukau",
# add another repo to push to all
git remote add all git://original/repo.git
git remote set-url --add --push all git://original/repo.git
git remote set-url --add --push all git://mirror-second/repo.git
git push all
# add to origin
git remote set-url --add --push origin git://original/repo.git
git remote set-url --add --push origin git://mirror-second/repo.git
@lukesUbuntu
lukesUbuntu / clean-up-boot-partition-ubuntu.md
Created May 1, 2019 05:27 — forked from ipbastola/clean-up-boot-partition-ubuntu.md
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@lukesUbuntu
lukesUbuntu / gist:d656c233d71120063db37e03eacb425b
Created March 16, 2019 00:31 — forked from dcblogdev/gist:8067095
Use Google finance calculator to convert currency with php
<?php
function convertCurrency($amount, $from, $to){
$data = file_get_contents("https://www.google.com/finance/converter?a=$amount&from=$from&to=$to");
preg_match("/<span class=bld>(.*)<\/span>/",$data, $converted);
$converted = preg_replace("/[^0-9.]/", "", $converted[1]);
return number_format(round($converted, 3),2);
}
echo convertCurrency("10.00", "GBP", "USD");
@lukesUbuntu
lukesUbuntu / code extensions
Last active March 11, 2018 09:14
my fav code extensions
code --install-extension HookyQR.beautify
code --install-extension Kasik96.format-php
code --install-extension RolandGreim.sharecode
code --install-extension Shan.code-settings-sync
code --install-extension Tobiah.unity-tools
code --install-extension Unity.unity-debug
code --install-extension aaron-bond.better-comments
code --install-extension christian-kohler.npm-intellisense
code --install-extension chrmarti.regex
code --install-extension codezombiech.gitignore
@lukesUbuntu
lukesUbuntu / Response.php
Created January 3, 2018 10:42
Handy json output class
<?php
/**
* User: luke hardiman
* Date: 2/20/15
* Time: 11:23 PM
* @Description : Handy json output class
*/
namespace Api;
class Response
#!/bin/sh
echo "Usage: dbdiff [user1:pass1@dbname1] [user2:pass2@dbname2] [ignore_table1:ignore_table2...]"
dump () {
up=${1%%@*}; user=${up%%:*}; pass=${up##*:}; dbname=${1##*@};
mysqldump --opt --compact --skip-extended-insert -u $user -p$pass $dbname $table > $2
}
rm -f /tmp/db.diff
@lukesUbuntu
lukesUbuntu / wholesalesms.php
Created April 8, 2017 06:11
basic wholesalesms class for sending txt messages
<?php
class wholesalesms {
var $api_key;
var $secret;
var $end_point;
public function wholesalesms($api_key,$secret,$end_point = 'https://app.wholesalesms.com.au/api/v2/'){
$this->api_key = $api_key;
$this->secret = $secret;
$this->end_point = $end_point;
@lukesUbuntu
lukesUbuntu / fix.sh
Last active December 26, 2016 08:51
fix for Error opening terminal: xterm-new.
#add to profile or just run
export TERM=xterm
@lukesUbuntu
lukesUbuntu / install_sshpass.sh
Created November 16, 2016 01:50
Install sshpass on mac osx
brew install http://git.io/sshpass.rb