Skip to content

Instantly share code, notes, and snippets.

Avatar
💻

Dave Schinkel dschinkel

💻
View GitHub Profile
View user-onboarding-welcome-message.spec.js
it('only sends one welcome message', async () => {
mockPost('/chat.postMessage', { called: true });
const channel = '';
const user: SlackUser = {
token: '',
trigger_id: '',
view: undefined,
id: '',
team_id: ''
};
View gist:b6a319d730e4651f73d42079317ad33c
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#define NUMBER_OF_DAYS 3
// Put your code below:
int main(void)
{
int k, highEntry, lowEntry;
printf("-- -= == IPC Temperature Analyzer == = --\n");
for (int i = 1; i < NUMBER_OF_DAYS; i++)
@dschinkel
dschinkel / MakeCallTest.java
Last active Aug 16, 2019
Roboelectric - Example of Finding a Child Fragment from a test
View MakeCallTest.java
/*
Dave Schinkel's Notes after he wrote this test:
This is a test I wrote headlessly with Roboelectric around an existing Legacy codebase that's a mess.
We want to get some sort of confidence with an integration test which is what this test gave us for a
certain part of this codebase.
This test indirectly tests behavior further down by
checking what I ultimately expected to be rendered
View gulpfile.js
const gulp = require('gulp'),
less = require('gulp-less'),
babel = require("gulp-babel"),
shell = require('gulp-shell'),
mocha = require('gulp-mocha'),
rename = require('gulp-rename'),
bro = require('gulp-bro'),
del = require('del'),
{ series, dest, src } = require('gulp');
@dschinkel
dschinkel / Calculator.kt
Last active May 28, 2019
Roman Numeral Calculator kata - Kotlin
View Calculator.kt
package roman.numeral.calculator.kotlin
class Calculator {
private val toRoman = mapOf(
"IIIII" to "V",
"VV" to "X",
"XXXXX" to "L",
"LL" to "C",
"CCCCC" to "D",
View Calculator.kt
package roman.numeral.calculator.kotlin
class Calculator {
private val toRoman = mapOf(
"IIIII" to "V",
"VV" to "X",
"XXXXX" to "L",
"LL" to "C",
"CCCCC" to "D",
"DD" to "M"
@dschinkel
dschinkel / SomeSpecUsingSuperagent.js
Last active May 14, 2019
Some example Mocha, Supertest, and Superagent tests I've written
View SomeSpecUsingSuperagent.js
/*
Note:
Uses superagent and mocha assertions.
This is how I do these tests nowdays, without supertest, just plain superagent.
*/
import request from 'superagent'
it('returns a list of participants', async () => {
const url = 'https://someurl';
@dschinkel
dschinkel / Collections.kt
Last active May 26, 2019
Kotlin Recipes / Example Snippets
View Collections.kt
/*
MUTABLE MAPS
------------
Note: Its type is inferred by underlying values within
*/
val toRoman = mutableMapOf(
"IIIII" to "V",
"VV" to "X"
)
View FakeNumberServer.java
import com.fasterxml.jackson.jr.ob.JSON;
import java.util.Map;
import static spark.Spark.get;
import static spark.Spark.port;
public class FakeNumberServer {
public static void main(String[] args) {
port(2000);
@dschinkel
dschinkel / RomanNumeralCalculator.java
Last active May 16, 2019
Roman Numeral Calculator Kata
View RomanNumeralCalculator.java
import com.sun.xml.internal.xsom.impl.scd.Iterators;
import java.util.ArrayList;
import java.util.HashMap;
public class RomanNumeralCalculator {
ArrayList<String> numeralOrder = new ArrayList<String>() {{
add("I");
add("V");
You can’t perform that action at this time.