Skip to content

Instantly share code, notes, and snippets.

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

öppenteknikstudio fiskurgit

🌑
...
View GitHub Profile
PShape sphere;
int sphereDetail = 8;
float xRotation;
float yRotation;
float zRotation;
ArrayList<PVector> coords = new ArrayList();
boolean rotateActive = true;
@fiskurgit
fiskurgit / 3Dto2D.pde
Created May 30, 2018 17:53
Draw 3d object in 2d space...
PShape shape;
float xmag, ymag = 0;
float newXmag, newYmag = 0;
void setup(){
size(500, 500, P3D);
noFill();
stroke(255, 0, 0);
shape = makeCube();
@fiskurgit
fiskurgit / FiskBottomSheetDialog.java
Last active January 25, 2019 04:23
Material Design 2 BottomSheetDialog that doesn't draw over the bottom navigation bar.
package online.fisk.kroki.views;
import android.app.Activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.graphics.Color;
import android.graphics.Point;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.GradientDrawable;
import android.os.Build;
int[] xAnchors = new int[4];
int[] yAnchors = new int[4];
int columns = 12;
int rows = 8;
int columnWidth;
int rowHeight;
int frameSize = 40;
tell application "System Events"
set change interval of current desktop to change interval of current desktop
end tell
@fiskurgit
fiskurgit / MicroBitSerialSpeech.py
Last active December 15, 2017 14:34
Text to Speech using Processing and a BBC Micro:Bit
from microbit import *
import speech
uart.init(9600)
word = ""
while True:
word = str(uart.readline())
if word and word != "None":
@fiskurgit
fiskurgit / QuickHullLatLng.java
Last active January 9, 2021 12:07
Convex Hull method using LatLng in a single pass instead of converting to points and back, for a set with 585 coords, time is 4ms versus 66ms
package fisk.convexhull;
import com.google.android.gms.maps.model.LatLng;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class QuickHullLatLng {
public ArrayList<LatLng> quickHull(List<LatLng> points) {
@fiskurgit
fiskurgit / charge.sh
Created June 14, 2016 18:01
Un-brick Android bash script
#!/bin/bash
fastboot getvar battery-voltage
fastboot reboot-bootloader
sleep 5s
bash ./charge.sh && exit

Keybase proof

I hereby claim:

  • I am fiskurgit on github.
  • I am fiskur (https://keybase.io/fiskur) on keybase.
  • I have a public key whose fingerprint is A100 5757 8E69 BFEA 76D3 3AEE 58D6 8052 4F96 14F5

To claim this, I am signing this object:

int step = 0;
int segmentCount = 70;
int startStep = 0;//offset the start position, not necessary but more interesting while drawing.
float pointDiameter = 0.25;
float plotRadius = 5;
float radiusIncrement = 6;
void setup(){
size(500, 500);
background(255);