Skip to content

Instantly share code, notes, and snippets.

View brookslyrette's full-sized avatar
🏠
Working from home from now until forever.

Brooks Lyrette brookslyrette

🏠
Working from home from now until forever.
View GitHub Profile
{
"manifest_version": 2,
"name": "Yet another XKCD substitutions chome extension",
"description": "Making everyday browsing a bit more fun",
"version": "1.0",
"browser_action": {
"default_icon": "/img/icon.png",
"default_title": "XKCD Substitutions"
},
"background": {
// plugin is enabled by default.
var enabled = true;
chrome.storage.sync.get('xkcdEnabled', function(result){
if (result.xkcdEnabled === undefined) {
// add config option to local storage
chrome.storage.sync.set({'xkcdEnabled': enabled}, function(){});
}
else {
// config is already set
enabled = result.xkcdEnabled;
// this script run on document_idle.
var substitutions = [
// Batman: http://www.xkcd.com/1004/
["Batman", "A man dressed like a bat"],
// s/keyboard/leopard: http://www.xkcd.com/1031/
["Keyboard", "Leopard"],
// Substitutions: https://xkcd.com/1288/
["Witnesses", "These dudes I know"],
["Allegedly", "Kinda probably"],
var msg = new SpeechSynthesisUtterance();
msg.text = "Hello World";
window.speechSynthesis.speak(msg);
if (a) {
//code
}
else if(b) {
//code
}
else {
//code
}
buildscript {
ext {
springBootVersion = '1.3.0.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
package org.broonix.controller;
import junit.framework.Assert;
import org.broonix.DemoStarterApplicationTests;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.ModelAndView;
/**
* Created by: Brooks Lyrette
@brookslyrette
brookslyrette / gist:1778c0d367d60efd1880
Last active January 28, 2016 21:07
AbstractAcceptanceTests
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = {SampleApplication.class}, name = "acceptanceTestContext")
@WebIntegrationTest
public abstract class AbstractAcceptanceTests {
}
@brookslyrette
brookslyrette / AbstractTestsWithH2Rollback
Created January 28, 2016 21:12
java backup and restore of h2 for unit tests
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = {SampleApplication.class}, name = "acceptanceTestContext")
@WebIntegrationTest
public abstract class AbstractAcceptanceTests {
@Autowired
protected JdbcTemplate jdbcTemplate;
/**
* Backs up the database before running this test.
@brookslyrette
brookslyrette / travis-config-ff
Created January 28, 2016 21:17
Travis Config for FF testing.
language: java
jdk:
- oraclejdk8
addons:
firefox: "42.0"
before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"