Skip to content

Instantly share code, notes, and snippets.

View jasperblues's full-sized avatar

Jasper Blues jasperblues

  • Earth (Mostly Australia & Philippines)
View GitHub Profile
@michael-simons
michael-simons / Application.kt
Last active February 18, 2024 10:55
Minimal Kotlin/Gradle Example for Neo4j OGM
package so
import org.neo4j.ogm.annotation.GeneratedValue
import org.neo4j.ogm.annotation.Id
import org.neo4j.ogm.annotation.NodeEntity
import org.neo4j.ogm.annotation.Relationship
import org.neo4j.ogm.config.Configuration
import org.neo4j.ogm.session.SessionFactory
@NodeEntity
@nicolas-miari
nicolas-miari / Array+ExportGif.swift
Last active August 29, 2019 16:06
Extension to Array<UIImage> to export the images as an animated gif.
import UIKit
import MobileCoreServices // needed for kUTTypeGIF
extension Array where Element == UIImage {
/**
Writes a looping animated gif to the documents folder, using the receiver's elements as the frames.
Based on [this answer](https://stackoverflow.com/a/46095888/433373) from Stack Overflow.
@jexp
jexp / rdbms2graph.groovy
Created November 13, 2019 10:29
Transfer Data from an RDBMS via JDBC to any Neo4j DB
@GrabConfig( systemClassLoader=true )
@Grapes([
@Grab(group='org.postgresql', module='postgresql', version='42.0.0'),
@Grab(group='org.neo4j.driver', module='neo4j-java-driver', version='1.7.5')
])
import org.neo4j.driver.v1.*;
import java.sql.*;
Class.forName("org.postgresql.Driver");
@blazewicz
blazewicz / pyenv-install.sh
Last active May 7, 2024 22:02
pyenv - Install Python 3.x with optimizations on macOS with macports
#!/bin/bash
set +x
PY_VERSION=3.10.1
export MAKE_OPTS="-j4"
export PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --enable-framework"
export PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --with-computed-gotos"
export PYTHON_CONFIGURE_OPTS="$PYTHON_CONFIGURE_OPTS --with-system-expat"
@jasperblues
jasperblues / SwiftUIAdapter
Last active December 23, 2020 02:50
Adapter allowing a UIKit controller to be backed by a SwiftUI view.
class SwiftUIAdapter<Content> where Content : View {
private(set) var view: Content!
weak private(set) var parent: UIViewController!
private(set) var uiView : WrappedView
var hostingController: UIHostingController<Content>
init(view: Content, parent: UIViewController) {
self.view = view
self.parent = parent
@aa755
aa755 / gist:f7be3bf8116930fd935251a1650633ff
Last active July 6, 2021 16:26
Ivermectin factcheck rebuttal
moved to https://aa755.github.io/decoding-human-body/ivermectin/2021/07/05/ivmrebuttal.html
@tylermorganwall
tylermorganwall / humanity_globe.R
Created August 17, 2021 14:37
3D Humanity Globe
library(rayshader)
library(rayrender)
popdata = raster::raster("gpw_v4_population_density_rev11_2020_15_min.tif")
population_mat = rayshader:::flipud(raster_to_matrix(popdata))
above1 = population_mat > 1
above5 = population_mat > 5
above10 = population_mat > 10
package com.example.molecues;
import java.util.Collections;
import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Supplier;
import org.springframework.boot.CommandLineRunner;