Skip to content

Instantly share code, notes, and snippets.

@morganp
morganp / chrome_ext.md
Created August 25, 2015 07:09
Chrome Extensions

uBlock Origin : Add blocker (Faster less resource intensive than adblock)

Lazarus: Form Recovery (just started using) http://lazarus.interclue.com/

Add to Amazon Wishlist (occasional use)

@morganp
morganp / links.md
Created August 3, 2015 10:25
Building Links
@morganp
morganp / east_lothian_timber.md
Last active August 29, 2015 14:26
Timber suppliers in East Lothian and the rest of Scotland

East Lothian

Not East Lothian

Berwickshire

Dunfermline

@morganp
morganp / disp2.m
Created July 15, 2015 22:09
Display with auto concationation and numeric converion to strings
function disp2( varargin )
%DISP2 Similar to disp but ...
% But no requirment for [] string concatination,
% Numerics automatically converted to strings.
str = '';
for i=1:length(varargin)
element = varargin(i); element = element{:};
if isnumeric(element)
@morganp
morganp / iphone6.rb
Last active August 29, 2015 14:22
iPhone 6 contracts cost analysis
#!/usr/bin/env ruby
# Direct Purchase Cost
iphone16 = 539
iphone64 = 619
puts "Memory upgrade costs #{iphone64 - iphone16 }"
# £5 a month PAYG on Three
@morganp
morganp / dlg_stock_calc.rb
Last active August 29, 2015 14:07
Stocks and share calculator fetches current DLG price
#!/usr/bin/env ruby
## Install Gem
# gem install stock_quote
require "stock_quote"
## Get price of DLG.DE stocks
stock = StockQuote::Stock.quote("DLG.DE").ask
@morganp
morganp / .vimrc
Created August 15, 2014 13:49
Vim disable cursors the smart way
noremap <Up> :echo 'Use k'<CR>
noremap <Down> :echo 'Use j'<CR>
noremap <Left> :echo 'Use h'<CR>
noremap <Right> :echo 'Use l'<CR>
@morganp
morganp / c_mkdir_example.c
Created June 16, 2014 13:13
Folder creation with C (mkdir)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
//## include <sys/stat.h> required for mkdir
// gcc c_mkdir_example.c -o c_mkdir_example
// c_mkdir_example
// ls -l
main () {
@morganp
morganp / compile
Created June 12, 2014 11:14
Functions return file pointer main and function split over files.
#!/bin/sh
gcc file_example_main.c file_example.c -o file_example