Skip to content

Instantly share code, notes, and snippets.

Avatar
🌑
...

öppenteknikstudio fiskurgit

🌑
...
View GitHub Profile
@fiskurgit
fiskurgit / QuickHullLatLng.java
Last active Jan 9, 2021
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
View QuickHullLatLng.java
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) {
View keybase.md

Keybase proof

I hereby claim:

  • I am fiskurgit on github.
  • I am fiskfamilj (https://keybase.io/fiskfamilj) on keybase.
  • I have a public key ASDKKMTTMqhjfFwDRUfgOuSMFqVDIpvXMeL0XEoYRWuIHgo

To claim this, I am signing this object:

@fiskurgit
fiskurgit / material_qt.py
Last active Jan 7, 2020
Using Qt in Python via QML (instead of inline code) with the Material Design style
View material_qt.py
import sys
from PySide2.QtQml import QQmlApplicationEngine
from PySide2.QtWidgets import QApplication
from PySide2.QtCore import Qt, QCoreApplication
if __name__ == "__main__":
sys_argv = sys.argv
sys_argv += ['--style', 'Material']
View Dither.py
from PIL import Image
from pathlib import Path
import random
def gray_value(r, g, b):
return 0.2989 * r + 0.5870 * g + 0.1140 * b
def filter_2x2_bayer(image_file, threshold):
View nd_lemniscate.pde
// ND Lemniscate rainbow curve in Processing: https://processing.org/
int iterations = 360;
int alphaDelta = 40;
int saturation = 170;
void setup(){
size(800, 600);
noStroke();
colorMode(HSB);
View Hexagrams.pde
import processing.pdf.*;
int VERTEXES = 6;
int columns = 24;
int rows = 24;
final float RADS = TWO_PI/VERTEXES;
PFont font;
PVector h1 = new PVector(0.0, 100.0);
View FiskDialog.kt
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
import android.support.design.widget.BottomSheetBehavior
import android.support.design.widget.CoordinatorLayout
@fiskurgit
fiskurgit / FiskBottomSheetDialog.java
Last active Jan 25, 2019
Material Design 2 BottomSheetDialog that doesn't draw over the bottom navigation bar.
View FiskBottomSheetDialog.java
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;
View Sparsno.pde
import processing.pdf.*;
float angleVarianzPIDivider = 3; //PI is divided by this number to define the variance in branching angles
float radius = 170; //randius of the snowflake
float endLength = random(1, 10);
float reduce = random(1.5, 2.5);
float randAngle = 0;
boolean single = true;
boolean record = false;
View Sparsno.kt
import org.openrndr.PresentationMode
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.math.Vector2
import kotlin.math.PI
import kotlin.random.Random
import org.openrndr.draw.Drawer
var angleVarianzPIDivider = 3f