Skip to content

Instantly share code, notes, and snippets.

View digitalextremist's full-sized avatar
🏴
demonstrate freedom

//de digitalextremist

🏴
demonstrate freedom
  • .*
  • Global Northwest
View GitHub Profile
@digitalextremist
digitalextremist / documentation-writer.xml
Created April 19, 2025 10:16 — forked from gc-victor/documentation-writer.xml
Technical Writer AI System Prompt
<system_prompt>
<credit>https://www.blog.philodev.one/posts/2024-07-writing-documentation</credit>
<persona>
You are an expert Technical Writer AI. Your core function is to create clear, accurate, accessible, and audience-centric technical documentation that is genuinely useful and easy to understand.
You MUST embody and apply the following principles in all your outputs:
</persona>
<principles>
@digitalextremist
digitalextremist / dismantler.cr
Last active January 30, 2020 17:34
Clarity.dismantler
module Clarity
alias Value = Nil | String | Bool |
Int64 |
Int32 |
Float64 |
Array(Value) |
Hash(String, Value)
def self.dismantler(a)
# Acts like an array and receives futures. Will yield them as
# they become ready.
class HackedMultiplexer
include Celluloid
include Enumerable
def initialize
@not_ready = []
end
@digitalextremist
digitalextremist / mocker.rb
Last active August 29, 2015 14:27
Mock Actor::System to simulate the arrival of running actors, for the Unlocker GSoC project.
require 'celluloid/current'
class Mocker
include Celluloid
MAX_INTERVAL = 20
MAX_WORK = 30
MAX_ID = 1000
attr_reader :id
def initialize(id)
@id = id
module System
extend self
def cpu_count
return Java::Java.lang.Runtime.getRuntime.availableProcessors if defined? Java::Java
return File.read('/proc/cpuinfo').scan(/^processor\s*:/).size if File.exist? '/proc/cpuinfo'
require 'win32ole'
WIN32OLE.connect("winmgmts://").ExecQuery("select * from Win32_ComputerSystem").NumberOfProcessors
rescue LoadError
Integer `sysctl -n hw.ncpu 2>/dev/null` rescue 1
end
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f425049b4c1, pid=19966, tid=139922265310976
#
# JRE version: Java(TM) SE Runtime Environment (8.0_25-b17) (build 1.8.0_25-b17)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.25-b02 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V [libjvm.so+0x3e94c1] CallGenerator::for_method_handle_inline(JVMState*, ciMethod*, ciMethod*, bool&)+0x591
#
@digitalextremist
digitalextremist / gist:9f6c9b556f0efefd0819
Created January 24, 2015 10:09
nio4r build failure @qrohlf gets on OSX 10.10
$ gem install nio4r -v '1.0.0'
ERROR: Error installing nio4r:
ERROR: Failed to build gem native extension.
/Users/qrohlf/.rbenv/versions/2.2.0/bin/ruby -r ./siteconf20150120-2702-11w6zzo.rb extconf.rb
checking for rb_thread_blocking_region()... no
checking for sys/select.h... yes
checking for poll.h... yes
checking for sys/epoll.h... no
checking for sys/event.h... yes
@digitalextremist
digitalextremist / mula.rb
Last active December 22, 2015 11:29
Futures interface silent death repro?
class Muile
include Celluloid
def router method, *args
puts "Called Muile.#{method}"
if respond_to? "#{method}!"
puts "Calling Muile.#{method}!"
send "#{method}!", *args
else
@digitalextremist
digitalextremist / http_parser.failure.log
Created May 28, 2013 06:18
http_parser.rb failing under rbx-head
NoMethodError: undefined method `request_path' on an instance of HTTP::Parser.
kernel/delta/kernel.rb:81:in `request_path (method_missing)'
/mu/penultimatix/reel/lib/reel/request_parser.rb:14:in `__script__'
/mu/penultimatix/reel/lib/reel/mixins.rb:51:in `path'
/mu/penultimatix/reel/lib/reel/rack_worker.rb:135:in `env'
/mu/penultimatix/reel/lib/reel/rack_worker.rb:95:in `request_env'
/mu/penultimatix/reel/lib/reel/rack_worker.rb:74:in `handle_request'
/mu/penultimatix/reel/lib/reel/rack_worker.rb:65:in `handle'
/usr/local/rvm/gems/rbx-head/bundler/gems/celluloid-594e63068e98/lib/celluloid/calls.rb:25:in `dispatch'
/usr/local/rvm/gems/rbx-head/bundler/gems/celluloid-594e63068e98/lib/celluloid/calls.rb:67:in `dispatch'
@digitalextremist
digitalextremist / aftermath.log
Created May 1, 2013 15:31
rubinius log from segv aftermath
root@two:~# cat /root/.rbx/rubinius_last_error_7339
Rubinius Crash Report #rbxcrashreport
Error: signal SIGSEGV
[[Backtrace]]
ruby[0x5904a0]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0)[0x7fdd3877acb0]
ruby(_ZN8rubinius11MachineCode11interpreterEPNS_5StateEPS0_PNS_20InterpreterCallFrameE+0x41eb)[0x5b5c5b]
ruby(_ZN8rubinius11MachineCode19execute_specializedINS_12TwoArgumentsEEEPNS_6ObjectEPNS_5StateEPNS_9CallFrameEPNS_10ExecutableEPNS_6ModuleERNS_9ArgumentsE+0x2a5)[0x5ef465]