class Object

Monkey patching Object like it's the golden old days

Monkey patching Object like it's the golden old days

new column for banal-code-archive probably: is_included_in_object/ruby/module

Constants

ALLOWED_MESSAGES_LIST
ALL_RETURN_STATEMENTS_ARE_ESSENTIAL

TODO:key => “value”, global law for ezii os §(INSPECT_STRINGS_MUST_BE_PREFIXED_WITH(“INSPECT:”))

ALL_RETURN_STATEMENTS_ARE_NOT_OPTIONAL
ALWAYS_PREFIX_INSPECT_STRINGS_WITH_THE_ENGLISH_WORD_INSPECT
ALWAYS_RESTART_SPRING_WHEN_CHANGES_OCCUR_IN_THIS_BLOCK
ANSWERS
APP_PATH
APP_ROOT

path to your application root.

ARGUMENT_WOULD_OTHERWISE_BE_ALWAYS_NIL

typed: strong

ASSERT_NO_DROPBOX_API_ERRORS
ASSIGNMENT_BEFORE_CODE_BLOCK_NOT_IN_CODE_BLOCK_END
ASSIGNMENT_BEFORE_CODE_BLOCK_NOT_IN_CODE_BLOCK_START
AVOID_INFINITE_RECURSION
AVOID_N_PLUS_1

Was wäre wenn Person A und Person B gleichzeitig zu Zeitpunkt T Quantum Q sich anschauen Observieren sie einen anderen Zustand Z von Quantum Q oder sehen Sie beide einen anderen Zustand Z_X?

BYPASS_GDPR_PROBLEM
CHANGE_HACKY_DUPLICATE_DEFINITION_OF_INSTANCE_VARIABLE
CHECK_FOR_TEMPFILE_NOT_REWINDED_ISSUE
COMMANDS_HELP
CURRENT_DISCORD_MESSAGE
CURRENT_PERCENTAGE_OF_SECRET_NON_PUBLIC_ACCESSIBLE_IMPLEMENTATIONS

typed: ignore

DELTA_MUST_BE_IMPLEMENTED_UNTIL_YEAR_2020_AC
DICTIONARY_DOT_COM_MUST_YIELD_CORRECT_SPELLING
DONT_CHANGE
DONT_CHANGE_EXCEPT_FOR_REFACTORING_TO_OOP
DRB_URI

The URI for the server to connect to

EEZEE_PREFIX
ERROR_INSPECT
ESSENTIAL_LOCAL_VARIABLE_DEFAULT_INITIALIZATION
EXECUTE_IN_SUCCESSION
EZII_OS_GDPR_COMPLIANCE_PROBLEM
FALSE_INSTEAD_OF_NIL_IS_ESSENTIAL
FIRST_STICK
FRONT_OBJECT

The object that handles requests on the server

GDPR_COMPLIANCE_IMPLEMENTATION
GDPR_COMPLIANCE_PROBLEM
HACK_MUST_BE_CHANGED
HARDWARE
IDEMPOTENCY_IS_QUESTIONABLE
IMPORTANT_TO_PROPAGATE_ARGUMENT
IP
LAW_MONITORS
LAYOUT_NIL_INTEGRAL_FOR_AVOIDING_INFINTE_RECURSION

end

LIMIT_SQL_SELECT_TO_TEN_TOTAL_RECORDS
LOCAL_VARIABLE_REQUIRED_SUFFIX__for_local_scope_mismmatch_prevention
LOG_FILE
MAKE_SURE_THE_LAST_LOC_ALSO_PRINTS_MEOW_WITHOUT_CHANGING_ANYTHTING_ONLY_VIA_QUANTUM_MAGIC
MUST_BE_TESTED
MUST_CHANGE_TO_SPELLING_COM

(

NIL_RIGHT_HAND_ASSIGMENT_MEANT_AS_UNDEFINED_FOR_SECURITY
NOT_DELETE_BEFORE_100_TEST_COVERAGE

paragraphs do

NOT_TO_BE_CHANGED_BEFORE_VOTES_EXEEDED_70_PERCENT
NO_LAYOUT_EXPECTS_FALSE_INSTEAD_OF_NIL
NO_RETURN_STATEMENTS_ALLOWED
[:delta_law, active_when: {is_functional: [:url,'https://spelling.com']}]

)

ORDER_OF_LOC_IS_IMPORTANT
ORDER_OF_LOC_IS_IMPORTANT_1
ORDER_OF_LOC_IS_IMPORTANT_2
ORDER_OF_LOC_IS_IMPORTANT_IMPORTANCE_IS_KNOWN
PUBLIC_METHOD_FILTER
REPO_PATHS
RETURN_STATEMENT_IS_ESSENTIAL
R_IP
SCREEN
SECOND_STICK
SERVER_URI
SHELL_PRINTF_IS_ESSENTIAL_SINCE_ECHO_ADDS_NEWLINE

typed: false

STILL_FAILS_SADLY
TEMPFILES_MUST_BE_SUPPORTED
TWITCH_CHANNEL
UNIMMUNIZED_FOR_ENDLESS_REDIRECTS_IN_COMBINATION_WTH
URL_MUST_RESOLVE
USER_OTHER_WEBSITES_GDPR_PROBLEM
USING_APPEND_OVER_SAFE_APPEND
USING_FORMAT_JPG_INSTEAD_OF_JPEG_CAUSES
VARIABLE_ASSIGNMENT_IN_COMPARE_STATEMENT_IS_ESSENTIAL_FOR
VARIABLE_COPIES_REFERENCE
VERBOSE
WIT

Public Instance Methods

NeuralNetwork() click to toggle source
# File browser/ezii-1.0.0/eezee-3-aka-game-x-engine/managables/services/chat-bot-integrations/chatbot.rb, line 125
def NeuralNetwork()
  NeuralNetwork.new
end
activate_bundler(bundler_version) click to toggle source
# File server/redux-os/bin/bundle, line 77
def activate_bundler(bundler_version)
  if Gem::Version.correct?(bundler_version) && Gem::Version.new(bundler_version).release < Gem::Version.new("2.0")
    bundler_version = "< 2"
  end
  gem_error = activation_error_handling do
    gem "bundler", bundler_version
  end
  return if gem_error.nil?
  require_error = activation_error_handling do
    require "bundler/version"
  end
  return if require_error.nil? && Gem::Requirement.new(bundler_version).satisfied_by?(Gem::Version.new(Bundler::VERSION))
  warn "Activating bundler (#{bundler_version}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_version}'`"
  exit 42
end
activation_error_handling() { || ... } click to toggle source
# File server/redux-os/bin/bundle, line 93
def activation_error_handling
  yield
  nil
rescue StandardError, LoadError => e
  e
end
at(x, y, str) click to toggle source
# File browser/ezii-1.0.0/ezii-client/managables/services/livestream-interactive/Twitch.Tv/zion_fleet.rb, line 3
def at(x, y, str)
  print "\033[#{y};#{x}H#{str}"
end
bundler_version() click to toggle source
# File server/redux-os/bin/bundle, line 63
def bundler_version
  @bundler_version ||= begin
    env_var_version || cli_arg_version ||
      lockfile_version || "#{Gem::Requirement.default}.a"
  end
end
cli_arg_version() click to toggle source
# File server/redux-os/bin/bundle, line 24
def cli_arg_version
  return unless invoked_as_script? # don't want to hijack other binstubs
  return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update`
  bundler_version = nil
  update_index = nil
  ARGV.each_with_index do |a, i|
    if update_index && update_index.succ == i && a =~ Gem::Version::ANCHORED_VERSION_PATTERN
      bundler_version = a
    end
    next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/
    bundler_version = $1 || ">= 0.a"
    update_index = i
  end
  bundler_version
end
discord_code_wrap(message) click to toggle source
# File browser/ezii-1.0.0/ezii-server/eezee.rb, line 1191
def discord_code_wrap(message)
  return  """
    ```elixir
    #{message}
    ```
  """
end
discord_shorten(message) click to toggle source
# File browser/ezii-1.0.0/ezii-server/eezee.rb, line 1188
def discord_shorten(message)
  discord_code_wrap(message.to_s[0...500])
end
env_var_version() click to toggle source
# File server/redux-os/bin/bundle, line 20
def env_var_version
  ENV["BUNDLER_VERSION"]
end
error_catching_restart_loop() click to toggle source
# File browser/ezii-1.0.0/eezee-3-aka-game-x-engine/managables/services/livestream-interactive/Twitch.Tv/twitch_zircon.rb, line 103
def error_catching_restart_loop
  start()
rescue => e
  error_catching_restart_loop()
  LOG_FILE.write(e.message)
end
gemfile() click to toggle source
# File server/redux-os/bin/bundle, line 40
def gemfile
  gemfile = ENV["BUNDLE_GEMFILE"]
  return gemfile if gemfile && !gemfile.empty?

  File.expand_path("../../Gemfile", __FILE__)
end
invoked_as_script?() click to toggle source
# File server/redux-os/bin/bundle, line 16
def invoked_as_script?
  File.expand_path($0) == File.expand_path(__FILE__)
end
liqudify(raw_data_object) click to toggle source
# File browser/ezii-1.0.0/ezii-client/managables/services/chat-bot-integrations/regexes.rb, line 102
def liqudify(raw_data_object)
  # https://stackoverflow.com/a/24076936/4132642
  i_ptr_int = raw_data_object.object_id << 1
  # https://stackoverflow.com/questions/47757960/how-to-get-value-at-a-memory-address-in-linux-shell

end
load_bundler!() click to toggle source
# File server/redux-os/bin/bundle, line 70
def load_bundler!
  ENV["BUNDLE_GEMFILE"] ||= gemfile

  # must dup string for RG < 1.8 compatibility
  activate_bundler(bundler_version.dup)
end
lockfile() click to toggle source
# File server/redux-os/bin/bundle, line 47
def lockfile
  lockfile =
    case File.basename(gemfile)
    when "gems.rb" then gemfile.sub(/\.rb$/, gemfile)
    else "#{gemfile}.lock"
    end
  File.expand_path(lockfile)
end
lockfile_version() click to toggle source
# File server/redux-os/bin/bundle, line 56
def lockfile_version
  return unless File.file?(lockfile)
  lockfile_contents = File.read(lockfile)
  return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/
  Regexp.last_match(1)
end
optional_prefix(prefix, message) click to toggle source

class Object

def ===(method, *args, &block)

TODO: also alllow Module === object => true if Module::Class === object => true

end

end

# File browser/ezii-1.0.0/eezee-3-aka-game-x-engine/managables/services/chat-bot-integrations/chatbot.rb, line 21
def optional_prefix(prefix, message)
  [prefix + message, message]
end
recursive_find(method_name, &find_condition_block) click to toggle source
# File browser/ezii-1.0.0/eezee-3-aka-game-x-engine/managables/programs/game_aided_manufacturing/gam.rb, line 10
def recursive_find(method_name, &find_condition_block)
  if find_condition_block.call(self)
    return self
  end

  if self.respond_to?(method_name)
    enumerable = self.public_send(method_name)
  elsif self.respond_to?(:each)
    enumerable = self.each
  else
    return nil
  end

  enumerable.each do |item|
    result = item.recursive_find(method_name, &find_condition_block)

    if not result.nil?
      return result
    end
  end

  return nil
end
start() click to toggle source
# File browser/ezii-1.0.0/eezee-3-aka-game-x-engine/managables/services/livestream-interactive/Twitch.Tv/twitch_zircon.rb, line 26
def start
  client = Zircon.new(
    server: 'irc.twitch.tv',
    port: '6667',
    channel: '#lemonandroid',
    username: 'lemonandroid',
    password: ENV["TWITCH_OAUTH_TOKEN"]
  )

  removed_colors = [:black, :white, :light_black, :light_white]
  colors = String.colors - removed_colors

  client.on_message do |message|
    puts ">>> #{message.from}: #{message.body}".colorize(colors.sample)
    LOG_FILE.write(message.body.to_s + "\n")


    if message.body.to_s =~ /!commands/
      client.privmsg("#lemonandroid", "https://twitter.com/LemonAndroid/status/1128262053880377345")
    end

    if message.body.to_s =~ /hack/
      `cliclick m:100,100`
    end

    if message.body.to_s =~ /open gam/
      `ruby /Users/lemonandroid/one/game/ruby/runnable.rb &`
    end

    if message.body.to_s =~ /bundle install/
      `cd /Users/lemonandroid/one/game/ruby && bundle install &`
    end

    if message.body.to_s =~ /move plane/
      `
        osascript -e 'tell application "System Events" to tell process "ruby"
          set frontmost to true

          key down "a"
          delay 1
          key up "a"
        end tell'
      `
    end

    if message.body.to_s =~ /([a-d])/
      client.privmsg("#lemonandroid", "Logged #{$1} in")

      `osascript -e 'tell application \"System Events\"  to tell process \"Google Chrome\"
        set frontmost to true
        keystroke \"#{$1}\"
      end tell'`
    end

    if message.body.to_s =~ /key press (\w)(?:\s*(\d+)x)?/
      if $2
        `osascript -e 'tell application \"System Events\"  to tell process "ruby"
          set frontmost to true

          repeat #{$2} times
            keystroke \"#{$1}\"
          end repeat
        end tell'`
      else
        `osascript -e 'tell application \"System Events\"  to tell process "ruby"
          set frontmost to true

          keystroke \"#{$1}\"
        end tell'`
      end
    end
  end

  client.run!
end
system!(*args) click to toggle source
# File server/redux-os/bin/setup, line 7
def system!(*args)
  system(*args) || abort("\n== Command #{args} failed ==")
end
wait_for(condition) click to toggle source
# File server/redux-os/os-root-scripts-on-top-of-linux/copy_and_paste.rb, line 31
def wait_for(condition)
  while true
    (FIRST_STICK, SECOND_STICK) do
      if(condition.call)
        §(RETURN_STATEMENT_IS_ESSENTIAL, DONT_CHANGE) do
          return
        end
      else
        sleep 0.1
      end
    end
  end
end
§(*paragraph_const) { || ... } click to toggle source
# File server/redux-os/os-root-scripts-on-top-of-linux/copy_and_paste.rb, line 10
def §(*paragraph_const) # laws, mostly things that shouldn't be changed
  yield
end
(*args) { || ... } click to toggle source
# File server/redux-os/os-root-scripts-on-top-of-linux/copy_and_paste.rb, line 6
def (*args) # changes for the future
 yield
end
∆⚕(*args) { || ... } click to toggle source
# File server/redux-os/os-root-scripts-on-top-of-linux/copy_and_paste.rb, line 18
def ∆⚕(*args)
  yield
end
(*args) { || ... } click to toggle source
# File server/redux-os/os-root-scripts-on-top-of-linux/copy_and_paste.rb, line 14
def (*args) # explanations
  yield
end