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 Node | |
attr_reader :to_s | |
def initialize op, a=nil, b=nil | |
if a.nil? | |
@to_s = op | |
return | |
end | |
case op | |
when :-@ |
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 <stdio.h> | |
int main(){ | |
int size = 24; | |
for(int y=0;y<size;printf("\n"),y++){for(int x=0;x<size;x++){ | |
int size = 24; | |
float a=0.1+(y-1.8*x)/size; | |
float b=1.2-(x+1.8*y)/size; | |
float c=b+(a<0?-a:a); | |
float d=(b+c-1.4); | |
d=d*d*d*d;d=d*d; |
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 B | |
extend self | |
@enabled = false | |
def enable! | |
return if @enabled | |
clear | |
@enabled = true |
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
rules: | |
- id: sample.abc | |
pattern: | |
subject: a.b.'c | |
where: | |
c: /.+/ | |
message: a | |
examples: | |
- before: 'a.b.c' | |
after: 'a.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
class Module | |
def to_enum(method_name) | |
original_method_name = :"__{method_name}_orig__" | |
alias_method original_method_name, method_name | |
define_method(method_name) do |*args, &block| | |
return enum_for(method_name, *args) unless block | |
__send__ original_method_name, *args, &block | |
end | |
end | |
end |
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
<script> | |
const scaleRatio = 0.75 | |
function humanFromCanvas(base, alpha){ | |
const output = document.createElement('canvas') | |
const size = 1024 | |
output.width = output.height = size | |
const ctx = output.getContext('2d') | |
ctx.globalAlpha = alpha || 1 | |
ctx.translate(size/2, size/2) | |
ctx.scale(scaleRatio, scaleRatio) |
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
def x;$x=!$x;end.tap do%) | |
def f(x) | |
if x | |
unless x | |
p :foo # ←ここに実行到達することは可能か? | |
end | |
end | |
end |
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
puts %( | |
moved to https://github.com/tompng/top_n_loader | |
) | |
exit | |
module TopNRecords | |
def self.parse_order(klass, order) | |
key, mode = begin | |
case order | |
when Hash |