Skip to content

Instantly share code, notes, and snippets.

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

öppenteknikstudio fiskurgit

🌑
...
View GitHub Profile
@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 {
@fiskurgit
fiskurgit / gist:9366187
Created March 5, 2014 12:21
Archive.org JSoup Scraper - Work in progress, and not pretty.
package com.fiskur;
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
/**
*
@fiskurgit
fiskurgit / gist:1bb7139d21c4b3db82ec
Created May 13, 2014 09:52
Original Google volley encodeParameters method
/**
* Converts <code>params</code> into an application/x-www-form-urlencoded encoded string.
*/
private byte[] encodeParameters(Map<String, String> params, String paramsEncoding) {
StringBuilder encodedParams = new StringBuilder();
try {
for (Map.Entry<String, String> entry : params.entrySet()) {
encodedParams.append(URLEncoder.encode(entry.getKey(), paramsEncoding));
encodedParams.append('=');
encodedParams.append(URLEncoder.encode(entry.getValue(), paramsEncoding));
@fiskurgit
fiskurgit / gist:9c21a55cb015065222b8
Last active August 29, 2015 14:01
Fixed Google Volley encodeParameters method
/**
* Converts <code>params</code> into an application/x-www-form-urlencoded encoded string.
*/
private byte[] encodeParameters(Map<String, String> params, String paramsEncoding) {
StringBuilder encodedParams = new StringBuilder();
try {
for(Iterator<Map.Entry<String, String>> i = params.entrySet().iterator(); i.hasNext(); ){
Map.Entry<String, String> entry = i.next();
@fiskurgit
fiskurgit / gist:766f315a12d7ee39af5a
Last active August 29, 2015 14:01
Perlin wave processing.org sketch
float noiseScale = 0.018F;
float n = 0.0F;
float speed = 0.4F;
int frameCount = 0;
void setup(){
size(600, 300);
frameRate(30);
}