Skip to content

Instantly share code, notes, and snippets.

View fiskurgit's full-sized avatar
🌑
...

öppenteknikstudio fiskurgit

🌑
...
View GitHub Profile
@fiskurgit
fiskurgit / index.php
Last active December 28, 2015 00:29
hexcol.net php source - includes building custom coloured favicons in code.
<?php
$uri = trim($_SERVER['REQUEST_URI'], '/');
$uri_array = explode('/', $uri);
$hexcol = $uri_array[0];
function hex2rgb($hex, $isArray) {
$hex = str_replace("#", "", $hex);
if(strlen($hex) == 3) {
@fiskurgit
fiskurgit / osgb2latlon.java
Last active December 30, 2015 11:19
Quickly hacked together Java app to read a CSV file and convert old OS Easting and Northing values to Latitude and Longitude. Dependencies: JCoord: http://www.jstott.me.uk/jcoord OpenCSV: http://opencsv.sourceforge.net/
package com.fiskur.osgb2latlon;
import au.com.bytecode.opencsv.CSVReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import uk.me.jstott.jcoord.LatLng;
import uk.me.jstott.jcoord.OSRef;
@fiskurgit
fiskurgit / osgb362wgs84.java
Created December 18, 2013 16:05
Converts a csv file that has mistakingly missed converting Latitude and Longitude from the OSGB36 datum to the WGS84 datum
package com.fiskur.osgb2latlon;
import au.com.bytecode.opencsv.CSVReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import uk.me.jstott.jcoord.LatLng;
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
mDrawerToggle.syncState();
}
@fiskurgit
fiskurgit / gist:8803490
Created February 4, 2014 13:24
BBC Basic plot
100 REM Circular 3D plot program
110 MODE1
120 GCOL0,2
130 VDU19,0,4,0,0,0
140 GCOL0,128:CLG
150 K=5*PI/10000
160 DEF FNA(Z)=10*SIN(K*(X*X+Y*Y))
170 FOR X=-100 TO 100 STEP 2
180 Z1=0
190 Y1=5*INT(SQR(10000-X*X)/5)
@fiskurgit
fiskurgit / gist:8804703
Last active August 29, 2015 13:56
BBC Basic plot
1 REM Rotation
10 MODE 4: VDU 29,640;512;: XS=4: YS=4
20 A=640: B=A*A: C=512
30 FOR X=0 TO A STEP XS: S=X*X: P=SQR(B-S)
50 FOR I= -P TO P STEP 6*YS
70 R=SQR(S+I*I)/A
80 Q=(R-1)*SIN(24*R)
90 Y=I/3+Q*C
95 IF I= -P THEN M=Y: GOTO 110
l00 IF Y>M M=Y: GOTO 130
@fiskurgit
fiskurgit / StarSpell.bas
Last active August 29, 2015 13:56
Work in progress
100MODE7
110REM"***** STARSPELL *****
130REM"(C)FISHER_MARRIOTT 1982
150REM"LIST BASED ON CLASSROOM INDEX
160REM"OF PHONIC RESOURCES N.A.R.E
161*SK
180DIMw$(20)
190DIMlist$(20)
200E$=STRING$(54,"?"):E$=""
210DIMN%(12):DIMP%(12):DIMQ%(12):DIMR%(12)
10 TRACEON
100 MODE7
110 REM ***** STARSPELL *****
130 REM (C)FISHER_MARRIOTT 1982
150 REM LIST BASED ON CLASSROOM INDEX
160 REM OF PHONIC RESOURCES N.A.R.E
161 REM *SK
180 DIM w$(20)
190 DIM lst$(20)
200 E$ = STRING$(54,"?") : E$=""
@fiskurgit
fiskurgit / bbcascii.pde
Last active August 29, 2015 13:56
Work in progress
PrintWriter output;
//String scale = "@ M B H E N R # K W X D F P Q A S U Z b d e h x * 8 G m & 0 4 L O V Y k p q 5 T a g n s 6 9 o w z $ C I u 2 3 J c f r y % 1 v 7 l + i t [ ] { } ? j | ( ) = ~ ! - < > ^ _ ' ; , : ` .";
String scale = "@ M B H E N R # K W X D F P Q A S U Z * 8 G & 0 4 L O V Y 5 T 6 9 $ C I 2 3 J % 1 7 + ? ( ) = ! - < > ' ; , : .";
String[] scaleChars = split(scale, " ");
String mImageFileName = "sal.jpg";
int mImageWidth = 529;
int mImageHeight = 532;
int mColumns = 65;
@fiskurgit
fiskurgit / hctojson.java
Created February 22, 2014 08:49
Parse hippocamp.net catalogue from html using JSoup
package hctojson;
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
public class hctojson {