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
class API::V1::BaseController < ApplicationController | |
skip_before_filter :verify_authenticity_token | |
before_filter :cors_preflight_check | |
after_filter :cors_set_access_control_headers | |
def cors_set_access_control_headers | |
headers['Access-Control-Allow-Origin'] = '*' | |
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS' |
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
# Add a disabled modules configuration to the script tag configuration | |
module IntercomRails | |
class ScriptTag | |
alias_method :original_intercom_settings, :intercom_settings | |
def intercom_settings | |
hsh = original_intercom_settings | |
hsh[:disable_modules] = ['messages'] | |
hsh | |
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
#!/usr/bin/env ruby | |
output = %x(/usr/local/bin/dlv-complex -silent #{ARGV[0]}) | |
output = output.scan(/[[:print:]]/).join | |
@answerset = Hash.new | |
def reset | |
@bracket_level = 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
require 'formula' | |
# Gets the latest Gnu Screen with 256 support | |
# Method from: | |
# http://ryanwilliams.org/2010/Oct/09/gnu-screen-256-colours-mac-os-x and | |
# http://pjkh.com/articles/2008/07/09/osx-iterm-screen-vim-256-colors | |
class Screen <Formula | |
head 'git://git.savannah.gnu.org/screen.git' | |
homepage 'http://www.gnu.org/software/screen/' |
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 'simple_agent' | |
class SaboteurAgent < SimpleAgent | |
on_percept :visibleEntity do |name, position, team, status| | |
next if team == @team | |
broadcast | |
if enemy = @enemies[name] | |
enemy.position = position |