Skip to content

Instantly share code, notes, and snippets.

View bkase's full-sized avatar

Brandon Kase bkase

View GitHub Profile
@bkase
bkase / CircleTimeActivity.java
Created January 18, 2012 22:38
CircleTimeActivity from mobile apps club
package org.cmu.mobileappsclub.circletime;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
@bkase
bkase / main.xml
Created January 18, 2012 23:00
main.xml for cmu mobile apps club (put this in res/layout/)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
@bkase
bkase / Jsson.scala
Last active December 10, 2015 01:48 — forked from kmizu/Jsson.scala
Type-safe concise JSON DSL
import org.json.{JSONObject, JSONArray}
/**
* Forked from https://gist.github.com/1240749
* Modified by bkase
*
* A concise typesafe JSON DSL in Scala.
* When you want to use, only
* import Jsson._ is needed.
* {
@bkase
bkase / Scala.sml
Created January 28, 2013 20:44
Making SML just a little bit more like Scala
datatype 'a Option = None | Some of 'a
@bkase
bkase / fileView.js
Created September 1, 2013 21:48
Ghetto Image Viewer
// Basically a combination of the answers from here: http://stackoverflow.com/questions/7414984/how-could-i-display-x-y-coordinates-on-image-in-real-time-to-the-user-when-the
$(function() {
var tooltip = $( '<div id="coords" style="position: absolute; background-color: white;">' ).appendTo( 'body' )[0];
var imgPos = [];
$( '#the_image' ).
each(function () {
imgPos = [
$(this).offset().left,

Keybase proof

I hereby claim:

  • I am bkase on github.
  • I am bkase (https://keybase.io/bkase) on keybase.
  • I have a public key whose fingerprint is 1322 E170 4A16 0B6B 0886 C5F8 6FE8 5BAA 5615 E495

To claim this, I am signing this object:

@bkase
bkase / gist:847351601b8c3a3df99d
Created August 20, 2014 04:31
Hang in Xcode beta 6
import Foundation
public class A<T> {
var callbacks: [A<T> -> ()] = []
public init() {
}
}
@bkase
bkase / gist:8afc20abbbe5730b8b3a
Created December 10, 2014 22:53
Assertion code in swift std library
/// User code assertions.
///
/// User code assertions and fatal errors are only enabled in debug mode. In
/// release or fast mode these checks are disabled. This means they may have no
/// effect on program semantics, depending on the assert configuration.
/// Traditional C-style assert with an optional message.
///
/// When assertions are enabled and `condition` is false, stop program
/// execution in a debuggable state after printing a message. When
/// assertions are disabled in release and fast builds, `condition` is not even
@bkase
bkase / apps_com.example.appname_BUCK
Last active February 24, 2020 02:00
Kotlin Buck build files
android_binary(
name = 'app',
manifest = 'AndroidManifest.xml',
keystore = ':debug_keystore',
use_split_dex = True,
primary_dex_patterns = [
'^com/tryroll/roll/AppShell^',
'^com/tryroll/roll/debug/AppShell^',
'^com/tryroll/roll/BuildConfig^',
@bkase
bkase / prnsaaspfruicc.md
Created March 3, 2016 22:58
Production-Ready(?) Native Single-Atom-State Purely Functional Reactive Composable UI Components, or PRNSAASPFRUICC

Production-Ready(?) Native Single-Atom-State Purely Functional Reactive Composable UI Components, or PRNSAASPFRUICC

The native UI toolkits on Android and iOS are frustratingly imperative. Unfortunately, there has been little architecture evolution (unlike the web). However, nothing(ish) is stopping us from bolting something "nice" on top. By nice I mean single-atom-state purely functional reactive composable UI components. In this post, I'll explain what this title means, the inspiration behind the design of the framework, an example component, and dive a little into the framework's implementation.

Right now, there only exists a Kotlin (Android) implementation, but a Swift port will be relatively straightforward and will happen soon.

Let's break down the title:

  • "Production-Ready"