Skip to content

Instantly share code, notes, and snippets.

View mslinn's full-sized avatar

Mike Slinn mslinn

View GitHub Profile
@mslinn
mslinn / restartXFCE4
Last active August 19, 2020 19:18
WSL2 XFCE4 setup
sudo apt install xfce4 xfce4-terminal xubuntu-desktop
@tarleb
tarleb / include.lua
Last active May 1, 2023 14:12
Filter to include Markdown files via code blocks
--- Pandoc Lua filter to include other Markdown files
---
--- Usage: Use a special code block with class `include` to
--- include Markdown files. Each code line is treated as the
--- filename of a Markdown file, parsed as Markdown, and
--- included. Metadata from include files is discarded.
---
--- Example:
---
--- ``` {.include}
@deanmarano
deanmarano / tested-jekyll.md
Last active July 22, 2023 17:26
Tested Jekyll

Testing Your Jekyll Site, The Ruby Way

Here at eSpark Learning, we use Jekyll to host our marketing site, https://www.esparklearning.com. Within eSpark Engineering, we love automated testing - most of our codebases require a passing test suite for all changes. As we add more javascript to our Jekyll site, we wanted to add a test framework that would give us real world tests - testing that the HTML was valid was no longer enough.

Acceptance Testing with RSpec, Capybara, and Selenium

To create real world acceptance tests for our site, we used a few technologies we were familiar with:

  • RSpec - Behaviour Driven Development for Ruby
  • Capybara - Test web applications by simulating how a real user would interact with your app
  • Selenium - Selenium automates browsers
@stonegao
stonegao / crdt.md
Created September 4, 2013 10:02 — forked from pozorvlak/crdt.md

CvRDTs are as general as they can be

What are you talking about, and why should I care?

Now that we live in the Big Data, Web 3.14159 era, lots of people want to build databases that are too big to fit on a single machine. But there's a problem in the form of the CAP theorem, which states that if your network ever partitions (a machine goes down, or part of the network loses its connection to the rest) then you can keep consistency (all machines return the same answer to

@mslinn
mslinn / javapDriver
Created December 18, 2012 23:28
Searches path for .class files compiled from specified Scala or Java class Usage: findClasses fileName [className] -c classpath; if not specified then all classes under target/scala-* are searched -e Exact match required for fileName, or className if specified -s Show javap decompilation output
#!/bin/bash
function help {
echo "Searches path for .class files compiled from specified Scala or Java class"
echo "Usage: $(basename $0) fileName [className]"
echo " -c classpath; if not specified then all classes under target/scala-* are searched"
echo " -e Exact match required for fileName, or className if specified"
echo " -s Show javap decompilation output"
exit -1
}
@mslinn
mslinn / play
Created November 24, 2011 04:53
Play Framework 2.0 start script for Cygwin (should work on all *nix variants)
#! /usr/bin/env bash
control_c() {
if $cygwin; then rm "$USERPROFILE"/play.boot.properties; fi
exit 1
}
case "`uname`" in
CYGWIN*) cygwin=true;;
esac
package com.promindis.game.snake.stm
import akka.actor.{ActorRef, Actor}
import java.awt.{Dimension, Graphics2D}
import java.awt.event.{ActionEvent, ActionListener}
import swing._
import swing.Dialog._
import swing.event.Key._
import swing.event.KeyPressed
@jorgeortiz85
jorgeortiz85 / process.scala
Created August 16, 2011 23:29
Scala Process Library
import scala.sys.process._
import java.io._
// Run a Process, return the output as a String
Process("echo foo") !!
// Run a Process, pipe in some input, and return the output as a String
Process("cat") #< (new ByteArrayInputStream("foobar".getBytes("UTF-8"))) !!
// Run a Process, pipe in some input, and pipe the output to a Array[Byte]