View wtf.txt
[aaron@TC omglolwut (master)]$ cat testing.rb
require 'test_helper'
def ex
raise Minitest::Assertion, "oops!"
rescue Minitest::Assertion => e
e
end
def alloc
View scheme.exs
cons = fn (a, b) -> fn x -> x.(a, b) end end
car = fn (p) -> p.(fn (q, _) -> q end) end
cdr = fn (p) -> p.(fn (_, q) -> q end) end
each = fn (list, func) ->
iter = fn (list, func, next) ->
(fn (a, nil) -> func.(a)
(a, b) -> func.(a); next.(b, func, next)
end).(car.(list), cdr.(list))
end
iter.(list, func, iter)
View heapviz.rb
require 'fiddle'
SIZEOF_HEAP_PAGE_HEADER_STRUCT = Fiddle::SIZEOF_VOIDP
SIZEOF_RVALUE = 40
HEAP_PAGE_ALIGN_LOG = 14
HEAP_PAGE_ALIGN = 1 << HEAP_PAGE_ALIGN_LOG # 2 ^ 14
HEAP_PAGE_ALIGN_MASK = ~(~0 << HEAP_PAGE_ALIGN_LOG) # Mask for getting page address
REQUIRED_SIZE_BY_MALLOC = Fiddle::SIZEOF_SIZE_T * 5 # padding needed by malloc
HEAP_PAGE_SIZE = HEAP_PAGE_ALIGN - REQUIRED_SIZE_BY_MALLOC # Actual page size
View libpq.diff
diff --git a/src/interfaces/libpq/exports.txt b/src/interfaces/libpq/exports.txt
index c69a4d5ea4..72c0d82533 100644
--- a/src/interfaces/libpq/exports.txt
+++ b/src/interfaces/libpq/exports.txt
@@ -170,3 +170,4 @@ PQsslStruct 167
PQsslAttributeNames 168
PQsslAttribute 169
PQsetErrorContextVisibility 170
+PQunescapeByteaConn 171
diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c
View forking_executor.rb
##
# Parallel test Runner for Rails
#
# This is a spike implementation for multi-process parallel testing with Rails.
# Only works with SQLite3 right now, and doesn't clean up.
#
# Here is an example of how to use it:
#
# ```ruby
# require 'forking_executor'
View reboot-cablemodem
#!/bin/sh
# Reboot netgear CM400 cablemodem via curl
curl -s -u admin:password 'http://192.168.100.1'$(curl -s -u admin:password http://192.168.100.1/RouterStatus.htm | grep id=[0-9] | cut -d'"' -f2) --data 'buttonSelect=2&wantype=dhcp&enable_apmode=0' > /dev/null
View heap_info.rb
require 'json'
require 'fiddle'
module HeapUtils
SIZEOF_HEAP_PAGE_HEADER_STRUCT = Fiddle::SIZEOF_VOIDP
HEAP_PAGE_ALIGN_LOG = 14
HEAP_PAGE_ALIGN = 1 << HEAP_PAGE_ALIGN_LOG
HEAP_PAGE_ALIGN_MASK = ~(~0 << HEAP_PAGE_ALIGN_LOG)
# SIZEOF_RVALUE = 56 # Only when GC_DEBUG is enabled
View compile.sh
cc `llvm-config --cflags` -c sum.c
c++ `llvm-config --cxxflags --ldflags --libs core mcjit native --system-libs` sum.o -o sum
View solving.rb
require 'ricosat'
require 'net/https'
class DepSolver
NotVariable = Struct.new :name, :number
class Variable < NotVariable
def initialize name, number
@not = NotVariable.new name, -number
super
View heap_utils.rb
require 'json'
require 'fiddle'
module HeapUtils
SIZEOF_HEAP_PAGE_HEADER_STRUCT = Fiddle::SIZEOF_VOIDP
HEAP_PAGE_ALIGN_LOG = 14
HEAP_PAGE_ALIGN = 1 << HEAP_PAGE_ALIGN_LOG
HEAP_PAGE_ALIGN_MASK = ~(~0 << HEAP_PAGE_ALIGN_LOG)
# SIZEOF_RVALUE = 56 # Only when GC_DEBUG is enabled