Skip to content

Instantly share code, notes, and snippets.

View djberg96's full-sized avatar

Daniel Berger djberg96

View GitHub Profile

Hit this on make release-macos.

Darwin Kernel Version 22.6.0: Wed Oct 4 21:25:26 PDT 2023; root:xnu-8796.141.3.701.17~4/RELEASE_X86_64 x86_64

openjdk version "14.0.2" 2020-07-14 OpenJDK Runtime Environment (build 14.0.2+12-46) OpenJDK 64-Bit Server VM (build 14.0.2+12-46, mixed mode, sharing)

GPL Ghostscript 10.01.2: **** Could not open temporary file tmp/gs_XXXXXX
require 'thread'
require 'thwait'
a = []
Dir["font-z*.rb"].each do |file|
next if file == __FILE__
next if file =~ /pixel/
font = File.basename(file, '.rb')
puts font
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# You will need Ruby on a Windows machine. Plus the ffi library.
require 'ffi'
class File::Temp
extend FFI::Library
ffi_lib :kernel32
attach_function :GetTempFileNameA, %i[string string uint buffer_out], :uint
attach_function :GetTempFileNameW, %i[buffer_in buffer_in uint buffer_out], :uint
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# user.rb
class User < ApplicationRecord
has_many :groups_users, :class_name => 'GroupsUsers'
has_many :groups, :through => :groups_users
end
# group.rb
class Group < ApplicationRecord
has_many :groups_users, :class_name => 'GroupsUsers'
#has_many :users, :through => :groups_users
[1] pry(main)> i = ActiveSupport::Inflector.inflections(:en)
=> #<ActiveSupport::Inflector::Inflections:0x0000000002532f30
@acronym_regex=/Api|GraphiQL/,
@acronyms={"api"=>"Api", "graphiql"=>"GraphiQL"},
@acronyms_camelize_regex=/^(?:(?-mix:Api|GraphiQL)(?=\b|[A-Z_])|\w)/,
@acronyms_underscore_regex=/(?:(?<=([A-Za-z\d]))|\b)((?-mix:Api|GraphiQL))(?=\b|[^a-z])/,
@humans=[],
@plurals=
[[/(z)ombies$/i, "\\1ombies"],
[/(z)ombie$/i, "\\1ombies"],
require 'hexapdf'
# Use local copy of http://foersom.com/net/HowTo/data/OoPdfFormExample.pdf
file = 'pdf_form_example.pdf'
doc = HexaPDF::Document.open(file)
page1 = doc.pages.first
widgets = page1[:Annots]&.filter{ |a| a[:Subtype] == :Widget }
# See what the widgets look like.