Skip to content

Instantly share code, notes, and snippets.

View jonoliver's full-sized avatar
💀
null === null

Jon Oliver jonoliver

💀
null === null
View GitHub Profile
class Player
def play_turn(warrior)
attack = AttackAction.new warrior
rest = RestAction.new warrior
walk = WalkAction.new warrior
for action in [attack, rest, walk]
if action.can?
action.go!
@jonoliver
jonoliver / index.html
Created July 5, 2016 02:57
Minimal valid HTML5
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>title</title>
<!-- <link rel="stylesheet" href="style.css"> -->
<!-- <script src="script.js"></script> -->
</head>
<body>
<!-- page content -->
@jonoliver
jonoliver / gilded_rose.rb
Created August 22, 2016 02:28
Gilded Rose Kata
require_relative 'item'
class GildedRose
def initialize items
@items = items
end
def update_quality
@items.each{ |item| update_item item }
@jonoliver
jonoliver / js
Created April 28, 2017 03:29
Get a random Wikipedia excerpt
$.getJSON("http://en.wikipedia.org/w/api.php?action=query&generator=random&grnnamespace=0&prop=extracts&exchars=500&format=json&callback=?", function(data) {
const article = data.query.pages[Object.keys(data.query.pages)[0]];
const body = $(article.extract).text();
console.log(article.title);
console.log(body);
});
@jonoliver
jonoliver / gist:ab4ba49955cd1397f3e4c226feec5d91
Created February 28, 2018 05:03 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@jonoliver
jonoliver / Bob.js
Last active July 7, 2021 22:10
Bob
// Team Reed, Sheridan, Zastrow and Jon
export const hey = (message) => {
if (isEmpty(message)) {
return 'Fine. Be that way!'
}
if (isAllCaps(message) && isQuestion(message)) {
return 'Calm down, I know what I\'m doing!'
}
if (isQuestion(message)) {