Skip to content

Instantly share code, notes, and snippets.

@anotherhale
anotherhale / TrainApp.scala
Last active June 11, 2020 20:07
Train App - not sure how to call the `allStations` query
package client
import client.TrainClient._
import sttp.client._
import sttp.client.asynchttpclient.zio.{ AsyncHttpClientZioBackend, SttpClient }
import zio.console.putStrLn
import zio.{ App, ExitCode, ZIO }
object TrainApp extends App {
@anotherhale
anotherhale / TrainClient.scala
Created June 11, 2020 19:57
Updated generated client with `allStations` query.
package client
import caliban.client.CalibanClientError.DecodingError
import caliban.client.FieldBuilder._
import caliban.client.SelectionBuilder._
import caliban.client._
import caliban.client.Operations._
import caliban.client.Value._
object TrainClient {
@anotherhale
anotherhale / bahn.graphql
Created June 11, 2020 19:54
Updated schema with no parameter query (allStations)
type BikeAttributes {
licensePlate: String!
}
type CarAttributes {
seats: Int!
color: String!
doors: Int!
transmissionType: String!
licensePlate: String
@anotherhale
anotherhale / custom-range-and-bearing.component.ts
Last active December 18, 2019 00:18
Custom Range and Bearing Angular-Cesium Component
import {
ChangeDetectionStrategy,
Component,
Input,
OnDestroy,
ViewChild
} from "@angular/core";
import {
AcLayerComponent,
AcNotification,
@anotherhale
anotherhale / SangriaNonDerived.scala
Last active September 22, 2018 05:38
Attempt to create Sangria API without derived types to experiment with interfacing with POJOs instead of Scala case classes.
// Author.java
class Author {
private String name;
private int publishedBooks;
Author(String _name , int _publishedBooks) {
name = _name
publishedBooks = _publishedBooks
}
String getName() {return name;}
void setName(String _name){ this.name = _name; }
@anotherhale
anotherhale / SangriaMutationExample.scala
Last active September 11, 2018 19:13 — forked from OlegIlyenko/SangriaMutationExample.scala
Simple example of a mutation with complex input type argument
import sangria.schema._
import sangria.execution._
import sangria.macros._
import sangria.macros.derive._
import sangria.marshalling.circe._
import scala.concurrent.ExecutionContext.Implicits.global
import io.circe.generic.auto._
import enumeratum._
sealed trait Genre extends EnumEntry
@anotherhale
anotherhale / brunch_window
Created December 8, 2014 02:18
Brunch Window
Got 387 coffee files and 170 jade files (bundled 52 of them together).
07 Dec 17:46:15 - warn: 'bower_components\aether\build\aether.js' compiled, but not written. Check your javascripts.joinTo co
nfig.
07 Dec 17:46:16 - warn: 'test\app\require.spec.coffee' compiled, but not written. Check your javascripts.joinTo config.
07 Dec 17:46:39 - info: compiled 38 files and 2 cached into 11 files in 43105ms
07 Dec 17:58:29 - warn: 'vendor\scripts\fancy_select.js' compiled, but not written. Check your javascripts.joinTo config.
07 Dec 17:58:29 - warn: 'vendor\scripts\flying-focus.js' compiled, but not written. Check your javascripts.joinTo config.
07 Dec 17:58:29 - warn: 'vendor\scripts\hsl-to-rgb.js' compiled, but not written. Check your javascripts.joinTo config.
07 Dec 17:58:29 - warn: 'vendor\scripts\lz-string-1.3.3-min.js' compiled, but not written. Check your javascripts.joinTo conf
@anotherhale
anotherhale / ByteArraySampleSource
Created November 14, 2014 19:18
ByteArraySampleSource used in ExoPlayer TextRenderer for renderering local subtitle (TTML) files.
import android.annotation.TargetApi;
import android.content.Context;
import android.os.AsyncTask;
import com.google.android.exoplayer.FormatHolder;
import com.google.android.exoplayer.SampleHolder;
import com.google.android.exoplayer.SampleSource;
import com.google.android.exoplayer.TrackInfo;
import com.google.android.exoplayer.TrackRenderer;
@anotherhale
anotherhale / DefaultRendererBuilder.java
Last active August 29, 2015 14:06
Modifited DefaultRendererBuilder to support external source Uri for TextRenderer.
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@anotherhale
anotherhale / subtitle_example.xml
Last active July 28, 2023 07:49
TTML Subtitle Example
<?xml version="1.0" encoding="UTF-8"?>
<tt xmlns="http://www.w3.org/ns/ttml">
<head>
<metadata xmlns:ttm="http://www.w3.org/ns/ttml#metadata">
<ttm:title>Timed Text TTML Example</ttm:title>
<ttm:copyright>The Authors (c) 2006</ttm:copyright>
</metadata>
<styling xmlns:tts="http://www.w3.org/ns/ttml#styling">
<!-- s1 specifies default color, font, and text alignment -->
<style xml:id="s1"