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 'minitest/autorun' | |
require 'stringio' | |
class DictionaryReplacer | |
MARK = '$' | |
ESCAPE = '\\' | |
def initialize(to_replace, dictionary) | |
@to_replace = StringIO.new(to_replace) |
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
1 patch for repository http://code.haskell.org/HaXml: | |
Sun Feb 16 10:47:50 ECT 2014 Justin Leitgeb <justin@stackbuilders.com> | |
* Fix compilation on Mac OS X | |
The build of HaXml is currently broken on Mac OS X. Since a lot of packages | |
depend on HaXml this is quite inconvenient. Below is a description of the | |
problem that was previously posted to Stack Overflow: | |
http://stackoverflow.com/questions/20497348/haxml-installation-issues-on-os-x-10-9-mavericks |
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 | |
# Example generated from https://github.com/edwinb/idris-demos/blob/master/RLE/rle-vect.idr. | |
class I_VM | |
attr_accessor :valstack, :valstack_top, :valstack_base, :ret, :callstack | |
def initialize() | |
@valstack = [] | |
@valstack_top = 0 | |
@valstack_base = 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
#!/usr/bin/env sh | |
GHC_VERSION_STRING=`ghc --version 2> /dev/null` | |
if [ $? -ne 0 ] | |
then | |
echo "Unable to obtain GHC version!" | |
exit 1 | |
fi | |
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
outsidein@ey05-s00398 ~ $ df -h | |
Filesystem Size Used Avail Use% Mounted on | |
/dev/sda1 6.0G 6.0G 0 100% / | |
udev 10M 124K 9.9M 2% /dev | |
shm 769M 0 769M 0% /dev/shm | |
/dev/sdb1 19G 2.4G 17G 13% /data |
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
# File activesupport/lib/active_support/core_ext/class/attribute_accessors.rb, line 10 | |
def cattr_reader(*syms) | |
options = syms.extract_options! | |
syms.each do |sym| | |
next if sym.is_a?(Hash) | |
class_eval("unless defined? @@\#{sym}\n@@\#{sym} = nil\nend\n\ndef self.\#{sym}\n@@\#{sym}\nend\n", __FILE__, __LINE__ + 1) | |
unless options[:instance_reader] == false | |
class_eval("def \#{sym}\n@@\#{sym}\nend\n", __FILE__, __LINE__ + 1) | |
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 'spec/runner/formatter/base_text_formatter' | |
require 'spec/runner/formatter/no_op_method_missing' | |
module Spec | |
module Runner | |
module Formatter | |
class ImmediateFailureFormatter < BaseTextFormatter | |
include NOOPMethodMissing | |
def example_failed(example, counter, failure) |
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 index | |
search = PartnerPage.find_all_by_indexed_name(params[:term]) | |
names = search.hits.map do |h| | |
name = h.stored(:name_kword) | |
url = partner_page_url(h.stored(:friendly_id)) | |
{ :value => name, :id => url } | |
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
SELECT DISTINCT message_id | |
FROM SELECT *, id AS message_id FROM user_messages WHERE user_id = ? | |
AND read = false AND parent_id IS NULL AS initial_messages | |
UNION | |
SELECT *, parent_id AS message_id FROM user_messages WHERE user_id = ? | |
AND read = false AND parent_id IS NOT NULL AS replies; |
OlderNewer