This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network "forwarded_port", guest: 3000, host: 3000 | |
# Create a private network, which allows host-only access to the machine | |
# using a specific IP. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
'use strict'; | |
var $window = $(window); | |
$.fn.appearingMenu = function() { | |
var targetElement = $('header'); | |
var menuElement = $(this); | |
menuElement.hide(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.progress { | |
border-radius: 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Class = function() { | |
var klass = function() { | |
this.init.apply(this, arguments); | |
} | |
// provide access to parent | |
//klass.prototype.parent = klass; | |
// called if the inheriting class doesn't override | |
klass.prototype.init = function() { }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
Object.prototype.createClass = function(obj) { | |
var self = {}; | |
var publicInterface = (obj['inherits'] && obj['inherits']()) || {}; | |
return (function() { return obj.func(self, publicInterface) }); | |
} | |
var larger = Object.createClass({ func: function(self, publicInterface) { | |
self.largerVar = "Larger"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'cuba' | |
require 'mustache' | |
require 'mustache_on_cuba' | |
Cuba.use Rack::Session::Cookie | |
Cuba.plugin MustacheOnCuba | |
Cuba.settings[:mustache] = { | |
views: File.join(File.dirname(__FILE__), "views"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'eventmachine' | |
class Server | |
attr_accessor :connections | |
def initialize | |
@connections = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
word_list = [] | |
generate_word = true | |
File.open("/usr/share/dict/words") do |words| | |
words.each { |word| word_list << word.strip } | |
end | |
puts "Grabbing a random word:" |