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 | |
ip = `ip addr | grep eth0 | grep inet | awk '{print $2}' | cut -f1 -d"/"` | |
pid_file = "/var/run/serf.pid" | |
if File.exists? pid_file | |
pid = File.read pid_file | |
Process.kill "INT", pid rescue nil | |
end |
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 'rack' | |
require 'sinatra/base' | |
class App < Sinatra::Base | |
use Rack::Static, :urls => ["/js"], :root => '.' | |
not_found do | |
halt 404, "nawp" | |
end |
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
#!/bin/sh | |
bundle install --binstubs | |
bundle exec rake db:drop RAILS_ENV=development | |
bundle exec rake db:drop RAILS_ENV=test | |
bundle exec rake db:create:all | |
bundle exec rake db:setup | |
bundle exec rake db:development:accounts | |
echo " |
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
--type-add=ruby=.ru | |
--type-set=haml=.haml | |
--type-set=sass=.sass,.scss | |
--type-add=html=.haml | |
--type-add=css=.sass,.scss | |
--type-add=html=.tpl |
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
drawLandmarks: function() { | |
var parent = this; | |
var createListenter = function(shapeMarker, landmark) { | |
google.maps.event.addListener(shapeMarker, 'click', function() { | |
parent.setLocation('activity', landmark.id, landmark.name, shapeMarker); | |
}); | |
} | |
for (var i = 0, landmark; landmark = this.landmarkData[i]; i++) { | |
if(landmark.type == "circle") { |
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
Zombie = require "zombie" | |
assert = require("chai").assert | |
$ = require "jquery" | |
describe "When first visiting the time entry page", -> | |
before (done) -> | |
@browser = new Zombie | |
@browser.visit("http://localhost:4567").then done, done |
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 'bundler/setup' | |
Bundler.setup | |
require "eventmachine" | |
require "em-websocket" | |
EM.run do | |
channel = EM::Channel.new | |
EM::WebSocket.start(host: "0.0.0.0", port: 2092, debug: true) do |ws| | |
ws.onopen do |
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
def self.define_scopes(&block) | |
class_eval do | |
missing = method(:method_missing) | |
undef :method_missing | |
def self.method_missing(method, *args, &block) | |
scope method, block | |
end |
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
# encoding: utf-8 | |
class AvatarUploader < CarrierWave::Uploader::Base | |
# Include RMagick or ImageScience support: | |
# include CarrierWave::RMagick | |
# include CarrierWave::ImageScience | |
# Choose what kind of storage to use for this uploader: | |
storage :file |