This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package audio.rabid.dev.utils; | |
import android.content.Context; | |
import android.support.annotation.Nullable; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ArrayAdapter; | |
import java.util.ArrayList; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package audio.rabid.dev.utils; | |
import android.content.Context; | |
import android.text.SpannableString; | |
import android.text.Spanned; | |
import android.text.method.LinkMovementMethod; | |
import android.text.method.MovementMethod; | |
import android.text.style.ClickableSpan; | |
import android.util.AttributeSet; | |
import android.view.View; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# get mac addresses for nearby devices | |
hcitool scan | |
# bind to a device | |
rfcomm bind 0 00:0D:18:00:00:01 | |
# open tty | |
minicom -D /dev/rfcomm0 | |
# press Ctrl-A Z A to turn line breaks on | |
# close when done: | |
rfcomm release /dev/rfcomm0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'csv' | |
require 'json' | |
# parse some json into hash array | |
data = JSON.parse(File.read("in.json")) | |
# get all headers appearing anywhere in data | |
keys = [] | |
data.each do |hash| | |
keys = keys.concat(hash.keys).uniq |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reqire 'csv' | |
csv = CSV.parse(File.read('input.csv')) | |
headers = csv.shift | |
objects = csv.map { |row| Hash[headers.zip(row)] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// KeyboardAvoidViewController.swift | |
// | |
// Created by Charles Julian Knight on 2/3/16. | |
// Copyright (c) 2017 Charles Julian Knight | |
// | |
// Permission is hereby granted, free of charge, to any person | |
// obtaining a copy of this software and associated documentation | |
// files (the "Software"), to deal in the Software without restriction, | |
// including without limitation the rights to use, copy, modify, merge, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Observable+Promise.swift | |
// | |
// Created by Charles Julian Knight on 1/2/17. | |
// Copyright © 2017 Charles Julian Knight. All rights reserved. | |
// | |
import Foundation | |
import RxSwift | |
import PromiseKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example | |
import kotlinx.coroutines.experimental.* | |
import java.util.concurrent.ExecutorService | |
import java.util.concurrent.Executors | |
/** | |
* simulated blocking operation | |
*/ | |
fun blockingFoo(x: Int): Int { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// see https://discuss.kotlinlang.org/t/units-of-measure/3454/7 | |
// see http://javanut.net/2017/05/23/more-fun-with-generics-in-kotlin/ | |
//class Bag<T> private constructor(val wrapped: List<T>): Collection<T> by wrapped { | |
// | |
// private class DefaultComparator<T>: Comparator<T> { | |
// override fun compare(o1: T, o2: T): Int = o1.toString().compareTo(o2.toString()) | |
// } | |
// | |
// companion object { |