This file contains hidden or 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
Unhandled exception: ctxlexpad needs an MVMContext | |
at src/gen/m-CORE.setting:13040 (./perl6/rakudo/install/share/perl6/runtime/CORE.setting.moarvm::33) | |
from src/gen/m-CORE.setting:13151 (./perl6/rakudo/install/share/perl6/runtime/CORE.setting.moarvm:AT-KEY:95) | |
from src/gen/m-CORE.setting:3756 (./perl6/rakudo/install/share/perl6/runtime/CORE.setting.moarvm:postcircumfix:<{ }>:30) | |
from lib/Debugger/UI/CommandLine.pm:735 (./perl6/rakudo/install/share/perl6/site/lib/Debugger/UI/CommandLine.pm.moarvm::82) | |
from src/gen/m-CORE.setting:10092 (./perl6/rakudo/install/share/perl6/runtime/CORE.setting.moarvm::558) | |
from src/gen/m-CORE.setting:10015 (./perl6/rakudo/install/share/perl6/runtime/CORE.setting.moarvm:reify:58) | |
from src/gen/m-CORE.setting:9931 (./perl6/rakudo/install/share/perl6/runtime/CORE.setting.moarvm::95) | |
from src/gen/m-CORE.setting:9927 (./perl6/rakudo/install/share/perl6/runtime/CORE.setting.moarvm::229) | |
from src/gen/m-CORE.setting:9901 (./perl6/rakudo/install/share/perl6/runtime/CORE |
This file contains hidden or 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
subset File of Str of *.IO.e; | |
enum Color «:BUG(37) :TODO(36) :FIXME(33) :XXX(31)»; | |
sub color(Color $c, Str $msg) { | |
"\033[$cm$msg\033[0m"; | |
} | |
sub process(File $file) { | |
gather for $file.lines.kv -> $i, $l { | |
take " $i: {Color::{$0}, $_)};" when /<|b>(BUG|TODO|FIXME|XXX)<|b>/; |
This file contains hidden or 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
import @ from "contracts.js"; | |
macro fun { | |
rule { | |
$name:ident ($contract ...) { $body ... } | |
} => { | |
@ $contract ... | |
function $name () { | |
return (function { | |
$body ... |
This file contains hidden or 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 QueryTrace | |
def self.enable! | |
::ActiveRecord::LogSubscriber.send(:include, self) | |
end | |
def self.append_features(klass) | |
super | |
klass.class_eval do | |
unless method_defined?(:log_info_without_trace) | |
alias_method :log_info_without_trace, :sql |
This file contains hidden or 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 RecordAddress | |
FIELDS = [:number, :country, :city_zip, :city_name, :street_name, | |
:latitude, :longitude, :geocoding_failed, :place_id] | |
BOOLEANS = [:geocoding_failed] | |
ASSOCIATIONS = [:place] | |
# @param [Object] object | |
# @param [Array] ary | |
def initialize(object, col) |
This file contains hidden or 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
#include <utility> | |
#include <vector> | |
#include <iostream> | |
#define ANY_OP(T, OP) bool operator OP(T el) { \ | |
for (const auto& elem : _elems) { \ | |
if (elem OP el) return true; \ | |
} \ | |
return false; \ | |
} |
This file contains hidden or 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 'test_helper' | |
class AbilityTest < ActiveSupport::TestCase | |
def setup | |
super | |
@ability_t = Ability.new(users(:translator_my)) | |
@ability_m = Ability.new(users(:manager_my)) | |
@ability_a = Ability.new(users(:admin_my)) | |
@proj1 = projects(:proj1) |
This file contains hidden or 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
macro $do { | |
rule {($($x = $y) (,) ...) $body} => { | |
(function ($x (,) ...) $body)($y (,) ...) | |
} | |
rule {$name ($($x = $y) (,) ...) $body} => { | |
(function $name ($x (,) ...) $body)($y (,) ...) | |
} | |
} | |
macro $var { |
This file contains hidden or 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
macro null_helper { | |
rule {($processed ...) ($rest)} => { | |
$processed (.) ... . $rest | |
} | |
rule {($processed ...) ($rest_head $rest ...)} => { | |
$processed (.) ... . $rest_head | |
&& null_helper ($processed ... $rest_head) ($rest ...) | |
} | |
} |
This file contains hidden or 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
// y-combinator | |
macro $y { | |
rule {( $var )} => { | |
function(){ | |
return function (f){ | |
return f(f) | |
}(function(f){ | |
return $var(function(x){ | |
return f(f)(x); | |
}) |