Skip to content

Instantly share code, notes, and snippets.

Avatar

Christian Williams xian

View GitHub Profile
@xian
xian / ConsoleFormatters.kt
Last active Oct 22, 2020
Chrome console formatters for Kotlin maps, sets, and lists
View ConsoleFormatters.kt
@file:Suppress("ObsoleteKotlinJsPackages")
package baaahs.util
import kotlin.browser.window
object ConsoleFormatters {
fun install() {
window.asDynamic().devtoolsFormatters = arrayOf(
map, set, list
View Glsl.kt
vertex shader:
#version 300 es
#ifdef GL_ES
precision mediump float;
#endif
in vec4 Vertex;
uniform mat4 viewProjMatrix;
View GlslBase.kt
package baaahs.glsl
import baaahs.*
import baaahs.geom.Vector2F
import baaahs.shows.GlslShow
import org.joml.Matrix4f
import org.lwjgl.BufferUtils
import org.lwjgl.glfw.GLFW.*
import org.lwjgl.glfw.GLFWErrorCallback
import org.lwjgl.glfw.GLFWFramebufferSizeCallback
View GlslBase.kt
package baaahs.glsl
import baaahs.*
import baaahs.geom.Vector2F
import baaahs.shows.GlslShow
import org.joml.Matrix4f
import org.lwjgl.BufferUtils
import org.lwjgl.glfw.GLFW.*
import org.lwjgl.glfw.GLFWErrorCallback
import org.lwjgl.glfw.GLFWFramebufferSizeCallback
View ShaderExample.kt
package baaahs.shaders
import org.joml.Matrix4f
import org.joml.Quaternionf
import org.lwjgl.BufferUtils
import org.lwjgl.glfw.GLFW.*
import org.lwjgl.glfw.GLFWErrorCallback
import org.lwjgl.glfw.GLFWFramebufferSizeCallback
import org.lwjgl.glfw.GLFWKeyCallback
import org.lwjgl.opengl.GL
View Kevmo.kt
import kotlin.math.PI
// declarations
interface ThingWithMass {
fun weightInKilograms(): Double
}
// create a class
open class Animal(var age: Int)
View Robolectric_Build_23.log
This file has been truncated, but you can view the full file.
Build 'Robolectric / Build' #23, branch 'fix-windows'
Started 2019-02-26 11:33:51 on 'Mobile-DevX-Lab-Windows' by 'Super user ()'
Finished 2019-02-26 11:42:25 with status FAILURE 'Tests passed: 4492, ignored: 31; gradle exception (new); exit code 1 (Step: Gradle)'
VCS revisions: 'git://github.com/robolectric/robolectric.git#refs/heads/master' (Git): 239a84240d9fd62c79d72d51f3d00ae1a0c46434 (branch 'refs/heads/fix-windows')
TeamCity URL http://dhcp-100-91-62-136.sfo.corp.google.com/viewLog.html?buildId=26&buildTypeId=Robolectric_Build
TeamCity server version is 2018.2.2 (build 61245), server timezone: PST (UTC-08:00)
[11:33:50]E: bt1 (8m:35s)
[11:33:50]i: TeamCity server version is 2018.2.2 (build 61245)
View Robolectric_Build_437.log
[13:36:08] : [Step 1/1] :shadowapi:testClasses
[13:36:09] : [Step 1/1]
[13:36:09] : [Step 1/1] > Task :shadowapi:test
[13:36:09] : [Step 1/1] :shadowapi:test
[13:36:09] : [:shadowapi:test] Running tests with [-Drobolectric.enabledSdks=28]
[13:36:09] : [Step 1/1] org.robolectric.util.ReflectionHelpersTest
[13:36:09] : [org.robolectric.util.ReflectionHelpersTest] org.robolectric.util.ReflectionHelpersTest.getFieldReflectively_getsInheritedFields
[13:36:09] : [org.robolectric.util.ReflectionHelpersTest] org.robolectric.util.ReflectionHelpersTest.callStaticMethodReflectively_rethrowsUncheckedException
[13:36:09] : [org.robolectric.util.ReflectionHelpersTest] org.robolectric.util.ReflectionHelpersTest.callConstructorReflectively_rethrowsError
[13:36:09] : [org.robolectric.util.ReflectionHelpersTest] org.robolectric.util.ReflectionHelpersTest.setFieldReflectively_givesHelpfulExceptions
View gist:eaf2746737ecb7f213eb1f219d1158ef
[17:54:09] :integration_tests:androidx:lint (3s)
[17:54:12] [:integration_tests:androidx:lint]
[17:54:12] [:integration_tests:androidx:lint] FAILURE: Build failed with an exception.
[17:54:12] [:integration_tests:androidx:lint]
[17:54:12] [:integration_tests:androidx:lint] * What went wrong:
[17:54:12] [:integration_tests:androidx:lint] Execution failed for task ':integration_tests:androidx:lint'.
[17:54:12] [:integration_tests:androidx:lint] > Lint found errors in the project; aborting build.
[17:54:12]
[17:54:12] Fix the issues identified by lint, or add the following to your build script to proceed with errors:
[17:54:12] ...
@xian
xian / build.gradle
Last active Oct 29, 2019
Download Robolectric dependencies for hermetic build
View build.gradle
def robolectricVersion = '3.3'
def androidSdkVersions = [
'4.1.2_r1-robolectric-0',
'4.2.2_r1.2-robolectric-0',
'4.3_r2-robolectric-0',
'4.4_r1-robolectric-1',
'5.0.0_r2-robolectric-1',
'5.1.1_r9-robolectric-1',
'6.0.0_r1-robolectric-0',
You can’t perform that action at this time.