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
" treetop.vim | |
" syntax file for treetop. | |
" Author: NANKI Haruo. | |
let b:ruby_no_expensive=1 | |
syntax match ttOperators /[&~!*+?\/]/ | |
syntax keyword ttDefine end | |
syntax keyword ttKeywords include super | |
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
diff --git a/ext/llvm_basicblock.cpp b/ext/llvm_basicblock.cpp | |
index e9937b1..83b5bc4 100644 | |
--- a/ext/llvm_basicblock.cpp | |
+++ b/ext/llvm_basicblock.cpp | |
@@ -133,7 +133,7 @@ llvm_builder_malloc(VALUE self, VALUE rtype, VALUE rsize) { | |
const Type *type; | |
Data_Get_Struct(rtype, Type, type); | |
- Value *size = ConstantInt::get(Type::Int32Ty, FIX2INT(rsize)); | |
+ Value *size = ConstantInt::get(Type::getInt32Ty(getGlobalContext()), FIX2INT(rsize)); |
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
@str = internal constant [4 x i8] c"%d\0A\00" | |
define void @main() nounwind { | |
%fact = call i32 @fact.tr(i32 5) | |
call i32 @printf( i8* getelementptr ([4 x i8]* @str, i32 0,i32 0), i32 %fact) | |
ret void | |
} | |
; tail recurse | |
define i32 @fact.tr(i32 %n) nounwind { |
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
; ModuleID = '<stdin>' | |
define void @main() nounwind { | |
%r.1 = alloca double ; <double*> [#uses=3] | |
store double 1.000000e+00, double* %r.1 | |
%r.9 = alloca double ; <double*> [#uses=3] | |
store double 9.000000e+00, double* %r.9 | |
br label %loop | |
loop: ; preds = %switch, %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
# editor.rb | |
# | |
# $ irb -reditor | |
# > Editor.edit("abc") # Edit "abc" with the external editor. | |
# => "abc has changed" | |
# | |
# Author: @nanki / nanki at dotswitch dot net | |
require 'tempfile' |
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
puts (1..100).map{|i|[[i, :Fizz], [:Buzz, :FizzBuzz]][(1 - i**4) % 5][(1 - i**2) % 3]} |
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 | |
require 'open3' | |
EXCLUDE_EXTENTSONS = %w(psd gif jpg png DS_Store tmp JPG PNG swp swf o bundle dylib so) | |
EXCLUDE_FROM_CURRENT = %w(estraier tmp log coverage build) | |
subdirs = Dir.glob("*") | |
subdirs -= EXCLUDE_FROM_CURRENT | |
def process_args(argv, _subdirs, _patterns) |
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 | |
# -*- coding: UTF-8 -*-; | |
require 'io/console' | |
require 'ansi' | |
class Textbox | |
def initialize(input=$stdin) | |
@input = input | |
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
--- console.c.orig 2011-09-09 04:59:09.000000000 +0900 | |
+++ console.c 2011-09-09 05:08:30.000000000 +0900 | |
@@ -4,6 +4,9 @@ | |
*/ | |
#include "ruby.h" | |
#include "rubyio.h" | |
+ | |
+#include <errno.h> | |
+ | |
#ifndef HAVE_RB_IO_T |
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
# $ echo 'class B;end' > b.rb | |
b = Thread.new { p autoload(:B, './b') } | |
sleep 0.00002 | |
b.kill | |
B |
OlderNewer