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 | |
module Parser; end | |
module Parser::PL | |
class Generic; end | |
class News < StandardPublication; 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
module D | |
@zmienna = 5 | |
class << self | |
attr_accessor :zmienna | |
end | |
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
Finished in 1.648384 seconds. | |
1) Failure: | |
test_basic_defsite_recording(TestCallSiteAnalyzer) [./rcov/test/call_site_analyzer_test.rb:39]: | |
<"#<struct Rcov::CallSiteAnalyzer::DefSite file=\"./rcov/test/assets/sample_03.rb\", line=3>"> expected but was | |
<"#<struct Rcov::CallSiteAnalyzer::DefSite file=\"./rcov/test/assets/sample_03.rb\", line=4>">. | |
2) Failure: | |
test_differential_coverage_data(TestCodeCoverageAnalyzer) [./rcov/test/code_coverage_analyzer_test.rb:102]: | |
<[4, 1, 0, 0, 4]> expected but was |
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
# Author:: Paweł Wilk (mailto:pw@gnu.org) | |
# Copyright:: Copyright (c) 2009 Paweł Wilk | |
# License:: LGPL | |
# | |
# This module is intended to be used as extension | |
# (class level mixin) for classes using some buffers | |
# that may be altered by calling certain methods. | |
# | |
# It automates resetting of buffers by installing |
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.attr_inheritable(*variables) | |
variables.each do |v| | |
module_eval %{ | |
def self.#{v} | |
@#{v} = superclass.#{v} if !instance_variable_defined?(:@#{v}) && superclass.respond_to?(:#{v}) | |
return @#{v} | |
end | |
} | |
end | |
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
# Enabling order for Radiant extensions migration. | |
# | |
# ------------------------------------------------- | |
# Modify environment.rb by putting this AFTER the line with 'config.extensions': | |
if ENV.has_key?('CONFIG_EXTENSIONS') | |
::PENDING_EXTENSIONS = config.extensions.clone | |
config.extensions = ENV['CONFIG_EXTENSIONS'].split(/[\,\ \:]+/).map{ |x| x.strip.to_sym } | |
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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.clone(); |
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
<?php | |
function mytheme_alpha_preprocess_node(&$vars) { | |
$node = $vars['node']; | |
if (isset($vars['field_topic'][0]['tid'])) { | |
$parents = taxonomy_get_parents($vars['field_topic'][0]['tid']); | |
$top_parent = array_shift($parents); | |
$vars['topic'] = field_view_value('node', $node, 'field_topic', array( | |
'tid' => $top_parent->tid, 'label' => 'hidden')); |
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 'eneltron.tokens) | |
(eneltron.tokens/initialize-tokenizer) | |
(def tekst "Siała baba mak. Nie wiedziała jak. Raz, dwa – oraz – 4.") | |
(time (def wynik (eneltron.tokens/tokenize tekst))) | |
; => "Elapsed time: 0.230337 msecs" | |
(apply print | |
(map #(str (apply str (next (str (:token-class (meta %1))))) " ->" \tab \tab (apply str %1) \newline) |
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
(defrecord XError [reason message response]) | |
(def default-messages | |
{:blabla "This is blabla" | |
:unknown "Unknown error" | |
:empty "Empty response"}) | |
(defn new-error | |
"Forms an error response when something goes wrong." | |
([reason response] |
OlderNewer