profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/rk/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Robert K rk @woodstreet United States http://www.woodst.com/ Zend Certified PHP Engineer, Web Programmer/Developer for @woodstreet Tinkerer, infrequent OSS contributor

rk/go-cron 206

A simple Cron library for go that can execute closures or functions at varying intervals, from once a second to once a year on a specific date and time. Primarily for web applications and long running daemons.

rk/werd 11

A variant of Chris Pound's word generator written in Ruby, with some improvements.

rk/uFramework 9

One of the smallest PHP MVC Frameworks around, brutally fast, and dedicated to simplicity and stability.

rk/perry 5

Perry is a small web framework with classy implications. Inspired by Sinatra and Sammy.js, Perry is named after Perry Como and utilizes closures (PHP 5.3) to respond to routes.

rk/Radiant-Less 2

Extends Radiant CMS with Less to extend CSS functionality with Less. Requires Less gem.

rk/artic-kiwi 1

a simple command-line bug tracker, written in Ruby (for fun)

rk/asEvented 1

Micro event emitter which provides the observer pattern to JavaScript object.

rk/chosen 1

Chosen is a library for making long, unwieldy select boxes more friendly.

rk/mvc-purist 1

An experimental MVVMC framework unprepared for prime time use, but amuses me in my spare time. This framework is a mixture of my own opinions and what I've picked up from Tom Butler (http://r.je/).

rk/Aura.Input 0

Tools to describe HTML form fields and values.

startedfabiospampinato/cash

started time in 11 days

startedsachinchoolur/replace-jquery

started time in 11 days

startedFiloSottile/age

started time in 12 days

startedhecrj/iced

started time in 21 days

startedalexusmai/laravel-file-manager

started time in 23 days

issue commentalchaplinsky/wfpc

Inaccurate Laravel performance due to stack mistakes

I don't use Docker, so I don't have any Docker specific advice to offer. Sorry. I don't know if this is helpful, but TechEmpower's benchmarks do use Docker and customize the php.ini settings: https://github.com/TechEmpower/FrameworkBenchmarks/blob/master/frameworks/PHP/laravel/laravel.dockerfile

Using Nginix pointed to the public directory should still be correct usage. I don't know if Nginx uses PHP-FPM by default, but I would guess it does.

Regarding different tweaks and improvements that can be done, to improve the performance of the app, I believe this is true for other frameworks as well. Each o them has some techniques for speeding up, but the goal was to test frameworks as they come out of the box (just by running them in the production environment). That's why I haven't considered changing opcache.max_accelerated_files.

As far as this goes, I would argue that for fair testing of any modern PHP app that uses composer, the following should be done for fair testing:

  • Disable xdebug.
  • Set opcache.max_accelerated_files to 40000.

This is because with Composer, PHP apps can face the same issue that Node + NPM can -- except worse. Where Node loads all those files, caches the compiled byte code and JITs it once -- PHP has to load the code for every request. This is why PHP-FPM and OPCache are necessary. They allow skipping the reload/recompile part of the process, putting the language closer to the 30ms performance mark.

I think xdebug is supported by PHP 8 now, but I don't think it's enabled by default. But that might depend on your distro's packaging.

rk

comment created time in 24 days

issue openedalchaplinsky/wfpc

Inaccurate Laravel performance due to stack mistakes

Hi,

I use Laravel every day, and saw this on Hacker News. So when I saw that the average response time for Laravel was 378.5ms, I wanted to chip in a few comments:

  • You use nginx as a referse-forward proxy to php serve. php serve has known performance issues when used for anything outside of development. I don't even use it for that, because of its wildly random performance characteristics.
  • You did not use nginx + PHP-FPM to serve the application. This is a typical server setup, because PHP-FPM provides huge performance boosts over CGI.
  • You did not disable the xdebug module, which is known to degrade performance 200-500% in performance environments. I have had pages take many seconds, only for them to take 100ms when I turned xdebug off. I think it's because of retaining stack frames, etc.
  • You also did not boost opcache.max_accelerated_files up to 40000 or more. Laravel uses a large number of files for the framework, so by keeping the default 10k files limit it won't cache everything with each request. See this.

Note: Ofcourse there are a lot of variables that influence application performance. A lot depends on a web server that you put in front of your application, so numbers above may vary in different configurations. The test was performed with webservers that are typical for the stack just to have a picture of how performance of those frameworks compare to each other.

Which makes the above highlighted section absolutely not true for Laravel. Now, to be clear: how you served the application would have negatively skewed any PHP framework's results. I know it was simple to do, but you went against best practices and even default OS-level installs for PHP hosting. Even a basic Apache + PHP set up will average 50-200ms for Laravel with minor optimizations.

Could you please take another look and try to fix how you're bootstrapping the environment?

created time in 24 days

startednuvious/pam-duress

started time in a month

issue commentaidenybai/million

Request: support setting data/aria attributes

I understand if supporting state in the DOM (like drag and drop) isn't in Million's use-case.

However, note that the library just doesn't work when setting data- or aria- attributes. I tested this before reporting. Just open the inspector here and selected a node, then $0["data-test"] = "foo" in the console. It'll write the property, but not to a data attribute. That same behavior goes to an aria attribute. Attributes !== properties!

Here's a JSBin example, you can inspect the target node: https://jsbin.com/ticodocoti/edit?html,css,js,output

These are features that should be supported, so that other libraries can interact with data attributes for additional behaviors, and so that the generated content can be more accessible with aria attributes.

rk

comment created time in a month

issue openedaidenybai/million

Request: support setting data/aria attributes

Is your feature request related to a problem? Please describe.

So, I've been trying to figure out how to associate nodes created by million with data in the rest of the script. Note that for this use-case I'm creating a menu builder using dragula to allow drag and drop ordering/nesting. As such, it's simpler to leverage the DOM to maintain the tree than in-memory within the script. Just query the parent wrapper, then walk down the nodes/children to reassemble the data. Because there are multiple layers and attributes to track, it's simplest to keep this data in a data-attribute.

<div class="menu-node" data-config='{"title":"foo","url":"/bar/","publish":true}'>
  <div class="menu-item">
    <span class="menu-item-title">foo</span>
    <span class="menu-item-url">/bar</span>
    <span class="menu-item-publish icon icon-eye"></span>
  </div>
  <!-- child nodes go here -->
</div>

Technically, setting a property like "data-config" works but I'm unsure how it'll be persisted. But this is a symptom of a another problem:

  • What if I added a link and need data-toggle="modal" data-target="#editModal" to be set on each item for a Bootstrap modal dialog? (I know I can set a .js-edit-modal class and an href of #editModal with a tiny bit of script to alleviate this.) I'm sure there are other 3rd party libraries which need data attributes that we cannot work around.
  • There is no way to assign arbitrary attributes because element.attributes is read-only. This also means that we cannot set aria- attributes for accessibility!

Describe the solution you'd like I'm pretty sure we need a way to set arbitrary attributes at least, which would also handle data attributes.

Describe alternatives you've considered For my own use-case I've considered using a WeakMap to maintain the data. But with patch(), but making it work with both an HTMLElement and a VNode is more complex. So I've thought about generating a random key to pass into patch, and using that string to associate it with a Map (it loses the automatic deletion of a WeakMap however).

No matter what alternative I'm considering, it's still more complex than a data attribute.

created time in a month

startedaidenybai/million

started time in a month

issue openedcodex-team/editor.js

[Bug] Pasted link cannot include spaces

I kept getting a front-end validation error when checking a link my client provided. Here's a sample one:

http://www.example.com/my-document v12.3.xslx

This is a valid URL when URL encoded to:

http://www.example.com/my-document%20v12.3.xslx

The average person who uses these code editors won't know about spaces in URLs, and most other tools tolerate the spaces. My search turned up this as the culprit:

https://github.com/codex-team/editor.js/blob/9cdda110dac04c70cf137ef324085e5326c448ec/src/components/inline-tools/inline-tool-link.ts#L326-L337

Maybe improving it to prefix search for http:, https:, or / would be better?

/^(http?s:|\/)/.test(str)

Steps to reproduce:

  1. https://editorjs.io/
  2. Select text in the editor
  3. Insert an inline link to http://www.example.com/my-document v12.3.xslx
  4. Note the URL validation error.

Expected behavior:

  • It should insert the link, optionally URL encoding it.

Screenshots:

Device, Browser, OS: any

Editor.js version: current

created time in a month

startedschollz/wifiscan

started time in 2 months

pull request commentfreqtrade/freqtrade

Feat/kevinjulian/add buy signal name

@xmatthias I'm @rk not @rokups. Please don't abbreviate at-mentions. 😩

kevinjulian

comment created time in 2 months

startedm-ender/gloomhaven-rules

started time in 2 months

startedyajra/laravel-datatables

started time in 2 months

startedm1guelpf/laravel-fastlogin

started time in 2 months

startedlaravel-arcanist/arcanist

started time in 3 months