Skip to content

Instantly share code, notes, and snippets.

View burtlo's full-sized avatar

Lynn Frank burtlo

View GitHub Profile
#! /usr/bin/env ruby
# encoding: utf-8
#
# Script to export the scripts inside the Scripts.rvdata2 data file to Data/exported_scripts as plain text Ruby files.
# If you run this script from inside RPG Maker VX Ace, I would suggest creating the Data/exported_scripts folder yourself
# as RGSS3 doesn't seem to support requiring FileUtils.
# Based on HIRATA Yasuyuki / 平田 泰行's rvdata2_dump.rb script: https://gist.github.com/hirataya/1853033
begin
require 'fileutils'
rescue LoadError
Bob = function() {
this.hey = function(message) {
if (this.isSilence(message)) {
return "Fine, be that way.";
} else if (this.isShouting(message)) {
return "Woah, chill out!";
} else if (this.isAQuestion(message)) {
return "Sure";
} else {
@burtlo
burtlo / bob.js
Created July 16, 2013 16:49
Bob with a little Backbone
$(function() {
var AppView = Backbone.View.extend({
el: $("#bobForm"),
events: {
"submit" : "askBob"
},
initialize: function() {
console.log("initializing bob app view");
},
@burtlo
burtlo / bob.js
Last active December 19, 2015 18:49
BobController = function(button,inputText,output,outputTemplate) {
console.log("Setting up the Bob Controller");
this.button = $(button);
this.input = $(inputText);
this.output = $(output);
this.outputTemplate = $(outputTemplate);
this.getStatement = function() {
return this.input.val();
}
_ = require('./underscore');
Scrabble = {
score : function(word) {
word = word || "";
var currentScore = 0;
var characters = _(word.split(""));
var totalScores = characters.map(function(letter) {
require('./scrabble');
describe('Scrabble', function() {
it("scores an empty word as zero",function() {
var score = Scrabble.score("");
expect(score).toEqual(0);
});
it("scores a null as zero",function() {
var score = Scrabble.score(null);
BobController = function(button,inputText,output) {
console.log("Setting up the Bob Controller");
this.button = $(button);
this.input = $(inputText);
this.output = $(output);
var that = this;
this.getStatement = function() {
return this.input.val();
@burtlo
burtlo / instructions.md
Last active December 19, 2015 04:29
Installing Ruby Processing on Windows 8
@burtlo
burtlo / script.js
Last active December 19, 2015 00:59
$(function() {
DoodlePanel = {
toggle: function() {
if (! this.exists()) {
this.create();
} else {
$(".doodle-popover").toggle();
}
},
exists: function() {
server "runtalk", :primary
default_run_options[:shell] = '/bin/bash'
# role :web, "digital"
# role :chat, "digital"
# role :api, "digital"
desc "echo"
task :echo do