Skip to content

Instantly share code, notes, and snippets.


Dave Pereira-Gurnell davegurnell

View GitHub Profile
davegurnell / MapControl.stores.tsx
Last active Aug 30, 2021
Experiment with custom controls in react-native-mapbox-gl/maps
View MapControl.stores.tsx
import MapboxGL from "@react-native-mapbox-gl/maps";
import { storiesOf } from "@storybook/react-native";
import React from "react";
import { StyleSheet, Text, TouchableNativeFeedback, View } from "react-native";
Gist to demonstrate an issue I had with @react-native-mapbox-gl/maps.
I'm trying to display a button over a map and allow the user to click it without
the event bubbling up to the map. However, calls to stopPropagation and preventDefault
View KleisliExample.scala
package sandbox
import cats.implicits._
case class User(username: String, avatarUrl: String, profileId: Int)
case class Avatar(url: String, monochrome: Boolean)
case class Profile(id: Int, age: Int)
object ComposingStuff extends App {
View testselectorlist.csv
We can't make this file beautiful and searchable because it's too large.
View ColorAndShape.scala
case class Color(red: Double, green: Double, blue: Double) {
def isLight: Boolean =
(red + green + blue) / 3.0 >= 0.5
def toGreyscale: Color = {
val avg = (red + green + blue) / 3.0
Color(avg, avg, avg)
View PropertyBasedTestingExample.scala
package basics
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks
import org.scalacheck.Gen
import org.scalacheck.Arbitrary
class MathSpec extends AnyWordSpec with Matchers with ScalaCheckDrivenPropertyChecks {
View IceCream.scala
// OBJECTS --------------------------------------
object iceCream {
val name = "Sundae"
val inCone = false
val numCherries = 1
def inGlass: Boolean =
davegurnell /
Created Oct 7, 2019
Conway's Game of Life Case Study

Case Study: Conway's Game of Life

Rules of Mob Programming

  • One keyboard, one screen
  • One driver, many navigators
  • Rotate driver every 15 minutes
  • Everyone gets time at the keyboard
  • Complete each story (plan, code, test) before moving on
  • Take breaks when you need to
View Dinner.scala
package code
import cats.implicits._
// Main.scala
object Main extends App {
val database = PersonDatabase.createTestDatabase
// 1. Write code to:
davegurnell / copy-responses-to-choices.js
Last active Nov 7, 2021
Script to copy the responses from a text field in one Google Form as choices in a multiple choice field in another Google Form
View copy-responses-to-choices.js
Configuration: Form URLs
You can get these from the address bar
davegurnell / karabiner.json
Created Jun 8, 2018
Karabiner Elements config file for British Microsoft Sculpt keyboard
View karabiner.json
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
"profiles": [
"complex_modifications": {
"parameters": {