Skip to content

Instantly share code, notes, and snippets.

View andrew-t's full-sized avatar

Andrew andrew-t

View GitHub Profile
@andrew-t
andrew-t / bond-film-generator.js
Last active February 26, 2020 22:04
Bond Film Title Generator
const fetch = require('node-fetch'),
cheerio = require('cheerio');
fetch('https://en.wikipedia.org/wiki/English-language_idioms')
.then(res => res.text())
.then(html => cheerio.load(html))
.then($ => {
const t = $('#mw-content-text .wikitable.sortable td:first-child');
for (let i = 0; i < 50; ++i) {
const words = $(t[rnd(t)]).text().split(' '),
@andrew-t
andrew-t / gormless-golf.js
Last active February 8, 2019 16:07
generates euphemisms for a notable online berksquad
// cmudict file at http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-0.7b
// for more info see http://www.speech.cs.cmu.edu/cgi-bin/cmudict
const dict = require('fs')
.readFileSync(__dirname + '/cmudict', 'utf8')
.split('\n')
.filter(x => x && x[0] != ';')
.map(x => {
const [ word, parts ] = x.split(' ');
return {
@andrew-t
andrew-t / star-wars-jenkins.css
Last active October 30, 2017 16:40
Make waiting for your Jenkins builds more exciting by replacing the console with a Star Wars style scroller
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document regexp("https:\/\/[ regexp'd jenkins url here ]\/.*console") {
#out,
.console-output {
text-transform: uppercase;
font-family: sans-serif !important;
perspective-origin: bottom;
transform: rotateX(45deg);
@andrew-t
andrew-t / bubbles.html
Last active August 29, 2015 14:04
Angular (in this case) bubbling problem
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.js"></script>
<script src="script.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body ng-app="app">
<div ng-controller="con">