View reproduction_steps.rb
1 2 3 4 5 6 7 8
require 'libxml'
require 'nokogiri'
 
loop do
nodes = Nokogiri::HTML::DocumentFragment.parse 'z<', 'utf-8'
node = nodes.children.first
node.replace node.content
end
View build
1 2 3 4
androidbuilder@aa3718480a89:~/android-haskell-activity$ arm-linux-androideabi-cabal build --verbose=3
Using internal setup method with build-type Simple and args:
["build","--verbose=3","--builddir=dist","--jobs=8","--with-gcc=/home/androidbuilder/.ghc/android-14/arm-linux-androideabi-4.8/bin/arm-linux-androideabi-gcc","--with-ghc=/home/androidbuilder/.ghc/android-14/arm-linux-androideabi-4.8/bin/arm-unknown-linux-androideabi-ghc","--with-ghc-pkg=/home/androidbuilder/.ghc/android-14/arm-linux-androideabi-4.8/bin/arm-unknown-linux-androideabi-ghc-pkg","--with-hsc2hs=/home/androidbuilder/.ghc/android-14/arm-linux-androideabi-4.8/bin/arm-unknown-linux-androideabi-hsc2hs","--with-ld=/home/androidbuilder/.ghc/android-14/arm-linux-androideabi-4.8/bin/arm-linux-androideabi-ld","--with-strip=/home/androidbuilder/.ghc/android-14/arm-linux-androideabi-4.8/bin/arm-linux-androideabi-strip","--hsc2hs-option=--cross-compile"]
("/home/androidbuilder/.ghc/android-14/arm-linux-androideabi-4.8/bin/arm-linux-androideabi-gcc",["
View gist:d9a71cc79ea5d56f35cc
1 2 3 4 5 6 7 8 9 10
androidbuilder@cf12994d95a0:~/foreign-jni$ arm-linux-androideabi-cabal install
Resolving dependencies...
Downloading text-1.2.0.4...
Downloading transformers-0.4.2.0...
Configuring text-1.2.0.4...
Configuring transformers-0.4.2.0...
Failed to install text-1.2.0.4
Build log ( /home/androidbuilder/.ghc/android-14/arm-linux-androideabi-4.8/.cabal/logs/text-1.2.0.4.log ):
[1 of 1] Compiling Main ( /tmp/text-1.2.0.4-59/text-1.2.0.4/dist/setup/setup.hs, /tmp/text-1.2.0.4-59/text-1.2.0.4/dist/setup/Main.o )
Linking /tmp/text-1.2.0.4-59/text-1.2.0.4/dist/setup/setup ...
View README.md

GIML

Gazay's incomplete Minimalistic Language.

By Alexey Gaziev.

Objectives

Smallest and incomplete language for big but simple config files. It should be so simple that you can write fast parser for it in few LOC and without heavy dependencies.

View gist:3938fdba455c6bf1bea0
1 2 3 4 5 6 7 8 9
import System.Random (newStdGen, randomR)
import Gimlh
import Data.List.Split (splitOn)
import Data.List (intercalate)
import Control.Monad.State
 
main = putStrLn $ runFaker $ do
n <- name
return $ unwords ["Hello", "my", "name", "is", n]
View raw
1
"require 'spec_helper'\n\ndescribe 't34' do\n let(:target) {\n\"class X\n def test_method(arg1)\n end\nend # X\"\n }\n\n let(:target2) {\n\"class X\n def test_method(xxx, arg2)\n end\nend # X\"\n }\n\n let(:source) {\n\"class X\n def test_method(arg1, arg2)\n end\nend\"\n }\n\n let(:rewriter) {\n T34::Rewriter.new source\n }\n\n it 'finds methods' do\n expect(rewriter.methods(:test_method)).to be_kind_of Array\n end\n\n it 'finds method nodes' do\n expect(rewriter.methods(:test_method).map(&:class).compact).to eq [T34::Rewriter::API::MethodNode]\n end\n\n it 'manipulates methods' do\n res = rewriter.methods(:test_method) do |method_node|\n method_node.args = method_node.args[0...-1]\n end\n expect(res[0].args.size).to eq 1\n end\n\n it 'manipulates arguments by name' do\n res = rewriter.methods(:test_method) do |method_node|\n method_node.args = method_node.args.select { |it| it.name != 'arg2' }\n end\n expect(res[0].args.size).to eq 1\n expect(rewr
View helper.rb
1 2 3 4 5 6 7 8 9 10
require 'fileutils'
 
class Helper
 
attr_accessor :dir, :temp_dir
attr_reader :template_path, :original_dir
 
def initialize(dir = nil)
@template_path = File.expand_path('../../app_template', __FILE__)
@original_dir = FileUtils.pwd
View client
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env ruby
 
client_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'proxy'))
$LOAD_PATH.unshift(client_dir) unless $LOAD_PATH.include?(client_dir)
require 'client'
 
# Get parameters and start the server
if ARGV.size == 2
port, proxy = ARGV
port = port.to_i
View proxy.rb
1 2 3 4 5 6 7 8 9 10
# Based on https://gist.github.com/74107 by # Copyright (C) 2009 Torsten Becker <torsten.becker@gmail.com>
#
# Rewrited by gazay
 
require 'socket'
require 'uri'
 
class Proxy
 
attr_accessor :socket
View gist:2629683
1 2 3 4 5 6 7 8 9 10
# implementation of Range#=== in 1.8.7 - it was the same method as Range#include?:
<<-EOS
static VALUE
range_include(range, val)
VALUE range, val;
{
VALUE beg, end;
beg = rb_ivar_get(range, id_beg);
end = rb_ivar_get(range, id_end);
Something went wrong with that request. Please try again.