Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
module Parser; end
module Parser::PL
class Generic; end
class News < StandardPublication; end
module D
@zmienna = 5
class << self
attr_accessor :zmienna
end
end
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
# 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
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
# 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
@siefca
siefca / robot.js
Created December 4, 2012 12:43 — forked from fabiopimentel/robot.js
[CAELUM TEAM]Megatron
//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();
<?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'));
@siefca
siefca / eneltron-example.clj
Created October 19, 2015 19:45
Eneltron's Tokenizer – example usage
(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)
@siefca
siefca / errors.clj
Last active February 4, 2021 10:15
Short-circuiting Clojure errors with exceptions
(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]