profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/damilare/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.
Damilare Onajole damilare I write in mostly Python, open to other langauges.

damilare/color-thief 1

Grabs the dominant color or a representative color palette from an image. Uses javascript and canvas.

damilare/django 1

The Web framework for perfectionists with deadlines.

damilare/django-realtime-tutorial 1

This is the code from my Django and Socket.IO realtime tutorial which you can find at http://maxburstein.com/blog/realtime-django-using-nodejs-and-socketio/

damilare/eye 1

Python object inspector

damilare/angry_bird 0

Angry Bird game using Unity Framework

damilare/ansible-django-stack 0

Ansible Playbook for setting up a Django app with Nginx, Gunicorn, PostgreSQL, Celery, RabbitMQ, Supervisor, Virtualenv, and Memcached. A Vagrantfile for provisioning a VirtualBox virtual machine is included as well.

damilare/Apollo-11 0

Original Apollo 11 guidance computer (AGC) source code for Command Module (Comanche054) and Lunar Module (Luminary099).

damilare/Audit 0

Audit to files for ZODB

damilare/awesome 0

A curated list of awesome lists

damilare/Awesome-Design-Tools 0

The best design tools for everything 👉

pull request commentdjango/django

Refs #32517 -- Allow calling reversed() on an OrderedSet

Maybe we should consider documenting it at this point?

We should probably keep this for internal use only - an orderedset package exists on PyPI.

diego-lima

comment created time in 4 hours

issue closedartf/grapesjs

FEAT: Make side panel's width to 20%

What are you trying to add to GrapesJS?

The side panel looks scrunched. Unless you've got a big desktop, I'd rather not have images from the blocks panel go off to the side. Additionally, the icons at the top e.g. "getting a new block" icon is just obscured unless you've got a decently large screen.

Describe your feature request detailed

Changing the width of the side panel from 15% to 20%, specifically the class: gjs-pn-views-container

Is there an alternative at the latest version?

[ ] Yes (descripe the alternative) [X] No

Is this related to an issue?

[ ] Yes (Give a link to the issue) [X] No

closed time in 6 hours

Andrew-Chen-Wang

issue commentartf/grapesjs

FEAT: Make side panel's width to 20%

For sure, I just don't think the demo should look all scrunched up like that :P I suppose it's personal opinion then.

Andrew-Chen-Wang

comment created time in 6 hours

pull request commentartf/grapesjs

fix to script saving to be resilient if scripts contain comments

Perhaps I could implement a component user script as a separate property and invoke it explicitly somehow by the particular component script?

It turns out that this approach works. FYI this is how I implemented it:

const script = function (props) {
    ...
    if (props['userscript'] && (!document.getElementById("wrapper"))) // exported mode
        eval(`(function(){\n${props['userscript']}\n}).bind(this)()`)
};

editor.DomComponents.addType(compType, {
    model: {
      defaults: {
        script,
        userscript: userScript1,
        'script-props': ['userscript'],
        traits: [
          {
            type: 'button',
            name: 'edit user script',
            text: 'Edit user script...',
            full: true,
            command: 'edit-script'
          }
        ]
      },

A huge positive is that because the component scripts aren't touched by users, the component script remains a function object and thus keeps updating itself as the app / component implementation script change over time. No component update problems anymore.

The main downside is that only components that I create myself, with those two magic lines of code in their official component script, can support user scripts. That's probably OK for my use case.

I'll continue to think about how this might be integrated deeper into Grapesjs so that any arbitrary component can have a 'user' script', which would be kind of cool.

abulka

comment created time in 10 hours

Pull request review commentdjango/django

Refs #32517 -- Allow calling reversed() on an OrderedSet

 def test_discard(self):         s.discard(2)         self.assertEqual(len(s), 1) +    def test_reversed(self):+        s = OrderedSet([1, 2, 3])+        self.assertEqual(list(reversed(s)), [3, 2, 1])

That's cleaner, thanks!

diego-lima

comment created time in 11 hours

Pull request review commentdjango/django

Refs #32517 -- Allow calling reversed() on an OrderedSet

 def test_discard(self):         s.discard(2)         self.assertEqual(len(s), 1) +    def test_reversed(self):+        s = OrderedSet([1, 2, 3])+        self.assertEqual(list(reversed(s)), [3, 2, 1])

Before this line, you can add s = reversed(s), and then check s in the following lines instead of reversed(s).

diego-lima

comment created time in 11 hours

Pull request review commentdjango/django

Refs #32517 -- Allow calling reversed() on an OrderedSet

 def test_discard(self):         s.discard(2)         self.assertEqual(len(s), 1) +    def test_reversed(self):+        s = OrderedSet([1, 2, 3])+        self.assertEqual(list(reversed(s)), [3, 2, 1])+        # Just checking that it's some iterator

Since you're checking against collections.abc.Iterator, you can leave this comment out. (I was suggesting a comment like that only if you were comparing it against the concrete type type(reversed({})).)

Also, you can use assertIsInstance() below: https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertIsInstance

diego-lima

comment created time in 11 hours

pull request commentdjango/django

Refs #32517 -- Allow calling reversed() on an OrderedSet

That last commit is meant to read "Checking OrderedSet.__reversed__()'s returned type.". my bad

diego-lima

comment created time in 11 hours

Pull request review commentdjango/django

Refs #32517 -- Allow calling reversed() on an OrderedSet

 def test_len(self):         s.add(2)         self.assertEqual(len(s), 2) +    def test_reversed(self):+        s = OrderedSet([1, 2, 3])+        self.assertEqual(list(reversed(s)), [3, 2, 1])

I also considered testing OrderedSets with miscellaneous data types (like user-defined class instances) rather than just integers.

You don't need to check with other data types, or modify other tests. Using integers is fine.

diego-lima

comment created time in 11 hours

pull request commentdjango/django

Refs #32517 -- Allow calling reversed() on an OrderedSet

sure thing @diego-lima I don't want to discourage you from contributing. I just want to make sure we're coherent in how we proceed with internal APIs because usually feature request against them are rejected.

diego-lima

comment created time in 11 hours

Pull request review commentdjango/django

Refs #32517 -- Allow calling reversed() on an OrderedSet

 def test_len(self):         s.add(2)         self.assertEqual(len(s), 2) +    def test_reversed(self):+        s = OrderedSet([1, 2, 3])+        self.assertEqual(list(reversed(s)), [3, 2, 1])

Well, I considered checking that, but I discarded it because that's actually just testing the native python implementation

No, it would be useful because it's checking what OrderedSet. __reversed__() returns. It's just that the answer is in terms of a Python dict.

diego-lima

comment created time in 11 hours

pull request commentdjango/django

Refs #32517 -- Allow calling reversed() on an OrderedSet

I mean it's great that we add support for it if we've got at least one usage internally

I agree.

Well, this feature request was accepted, and seemed like a low-hanging fruit for me. I've been using Django for some years now (since version 1.8), and always felt like giving back. Now I'm getting the chance to do just that, so I really appreciated this easy picking.

diego-lima

comment created time in 11 hours

pull request commentdjango/django

Refs #32517 -- Allow calling reversed() on an OrderedSet

Not sure I understand the motives for this change.

It's probably better to discuss that on the ticket. I can answer there.

diego-lima

comment created time in 11 hours

Pull request review commentdjango/django

Refs #32517 -- Allow calling reversed() on an OrderedSet

 def test_len(self):         s.add(2)         self.assertEqual(len(s), 2) +    def test_reversed(self):+        s = OrderedSet([1, 2, 3])+        self.assertEqual(list(reversed(s)), [3, 2, 1])

Well, I considered checking that, but I discarded it because that's actually just testing the native python implementation reversed(d: dict).

I also considered testing OrderedSets with miscellaneous data types (like user-defined class instances) rather than just integers. But then again, that would be testing python's set checking, be it through __id__ (for unhashable custom objects) or __hash__ and __eq__. I figured that's why the previous tests don't bother with that.

Do you think it's adequate to extend not only mine, but also the previous tests?

diego-lima

comment created time in 12 hours

startedFD-/RPiPlay

started time in 12 hours

PublicEvent

Pull request review commentdjango/django

Refs #32517 -- Allow calling reversed() on an OrderedSet

 def test_len(self):         s.add(2)         self.assertEqual(len(s), 2) +    def test_reversed(self):+        s = OrderedSet([1, 2, 3])+        self.assertEqual(list(reversed(s)), [3, 2, 1])

Yes, that's okay. That's a kind of iterator. In your test, one way to do it would be to check that the type of the return value is the same as type(reversed({})), maybe with a comment that you're doing that to check that it's some iterator, rather than that particular one. If you wanted to be fancier, there's probably a way to do it using collections.abc: https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterator

diego-lima

comment created time in 13 hours

Pull request review commentdjango/django

Refs #32517 -- Allow calling reversed() on an OrderedSet

 def test_len(self):         s.add(2)         self.assertEqual(len(s), 2) +    def test_reversed(self):

Nice! 441bfded3f1028a04ba1c547f5bf588302e4e407

diego-lima

comment created time in 13 hours

Pull request review commentdjango/django

Refs #32517 -- Allow calling reversed() on an OrderedSet

 def test_len(self):         s.add(2)         self.assertEqual(len(s), 2) +    def test_reversed(self):+        s = OrderedSet([1, 2, 3])+        self.assertEqual(list(reversed(s)), [3, 2, 1])

reversed(s) evaluates to something like <dict_reversekeyiterator object at 0x7fc4ea8d56d0>, just like iter(s) evaluates to <dict_keyiterator object at 0x7fc4ea7554f0>:

from django.utils.datastructures import OrderedSet
s = OrderedSet([1, 2, 3])
print(reversed(s)) # <dict_reversekeyiterator object at 0x7fc4ea8d56d0>
print(iter(s))     # <dict_keyiterator object at 0x7fc4ea8d56d0>

That's OK, right?

diego-lima

comment created time in 13 hours

Pull request review commentdjango/django

Refs #32517 -- Allow calling reversed() on an OrderedSet

 def test_len(self):         s.add(2)         self.assertEqual(len(s), 2) +    def test_reversed(self):+        s = OrderedSet([1, 2, 3])+        self.assertEqual(list(reversed(s)), [3, 2, 1])

Sorry, the return value should be an iterator, not an OrderedSet. It might be good to check that.

diego-lima

comment created time in 14 hours

Pull request review commentdjango/django

Refs #32517 -- Allow calling reversed() on an OrderedSet

 def test_len(self):         s.add(2)         self.assertEqual(len(s), 2) +    def test_reversed(self):

I would put this test method right before test_contains() to match the order of the methods in the class.

diego-lima

comment created time in 14 hours

Pull request review commentdjango/django

Refs #32517 -- Allow calling reversed() on an OrderedSet

 def test_len(self):         s.add(2)         self.assertEqual(len(s), 2) +    def test_reversed(self):+        s = OrderedSet([1, 2, 3])+        self.assertEqual(list(reversed(s)), [3, 2, 1])

Before checking the return value's contents, you should check that its type is OrderedSet.

diego-lima

comment created time in 14 hours

Pull request review commentdjango/django

Fixed #29606 -- Added system check for the type of ALLOWED_HOSTS.

     id='security.W022', ) +W023 = Warning(

This should be W024 (since there is already an E023).

Also it feels like this should be an error not a warning. If the check fails we will get an error (in behaviour) somewhere down the line. It would also be consistent with other checks similar to this.

elmcrest

comment created time in 14 hours

PR opened django/django

Refs #32517 -- Allow calling reversed() on an OrderedSet
+7 -0

0 comment

2 changed files

pr created time in 14 hours

Pull request review commentdjango/django

Fixed #24141 -- Added QuerySet.contains().

 But:  .. _overuse_of_count_and_exists: -Don't overuse ``count()`` and ``exists()``-------------------------------------------+Don't overuse ``contains()``, ``count()``, and ``exists()``+-----------------------------------------------------------

See ticket-32518.

schyffel

comment created time in 15 hours

push eventdjango/django

Johan Schiff

commit sha d01709aae21de9cd2565b9c52f32732ea28a2d98

Fixed #24141 -- Added QuerySet.contains().

view details

push time in 15 hours

PR merged django/django

Fixed #24141 -- Added QuerySet.contains().
+132 -18

1 comment

7 changed files

schyffel

pr closed time in 15 hours

push eventartf/grapesjs

Dmytro Bartieniev

commit sha cb705986bdc390308af6cb210ce3cd0d44fc40d5

Change units on resizing to pixels

view details

Dmytro Bartieniev

commit sha 8d97c10fc67ba12e76e71202e735bdfd826b11b3

Revert "Change units on resizing to pixels" This reverts commit 603e177baedd812cb5b899bac0d2ae7e738c701b.

view details

Dmytro Bartieniev

commit sha e30d8e9d6ac154c1f458e6b1edc0f798d9e6e57d

Add different formula for calculating width and height on percentage unit selection

view details

Dmytro Bartieniev

commit sha 5fc3bec4fa0415433f57253923228e97536eb195

Add calculation of element width and height based on selected unit

view details

Dmytro Bartieniev

commit sha 7a1228f699405984c6de7caf03e2bb3de5161df1

Reduce minDim default value

view details

dependabot[bot]

commit sha 00eed038880b3fd292fab8b4fc4e5b59c7043068

Bump prismjs from 1.22.0 to 1.23.0 Bumps [prismjs](https://github.com/PrismJS/prism) from 1.22.0 to 1.23.0. - [Release notes](https://github.com/PrismJS/prism/releases) - [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md) - [Commits](https://github.com/PrismJS/prism/compare/v1.22.0...v1.23.0) Signed-off-by: dependabot[bot] <support@github.com>

view details

Artur Arseniev

commit sha e3c374595b03800310c73006f2262e0811db15a0

Update Frame api for the main component

view details

Artur Arseniev

commit sha 5a2812bf3caf6be2c7e8880b352067ad075a5032

Add a test for the initialization of pages

view details

Artur Arseniev

commit sha 03174fe149b7bfbc818ffc8d5c0806b826648036

Start update UndoManager for multipages

view details

Andy Bulka

commit sha c5df3786914f8f7207358f7d51f8b14a3bcbf924

fix to script saving to be resilient if scripts contain comments

view details

Artur Arseniev

commit sha 56890aea5b188b223695130e9f1b06234980c055

Switch undo manager on page change

view details

Artur Arseniev

commit sha cacdc73914612d014e62e37d584c589a6c11d717

Register undo manager for the wrapper of the new changed page

view details

Artur Arseniev

commit sha 6883a0b559c48304f6627996d1e3bf065feb7bfe

Start and resume tracking of undo managers on switch

view details

Artur Arseniev

commit sha f651584234c1d043880b773e12c915a946137a4c

Rollback UndoManager changes

view details

Artur Arseniev

commit sha 031b2b00938ab3f475d56c38ca013f3bf456219f

Register pages in undo manager

view details

Andy Bulka

commit sha 0e94c08bbc28a92fd8e488018486c0e83069eb21

newline fix for build() needed too

view details

Artur Arseniev

commit sha 18b2f95b7f844578dc2b28d786b126013d155d9e

Merge pull request #3220 from kuhelbeher/fix/percentage_resize Closes #3186 Change units on resizing to pixels

view details

Artur Arseniev

commit sha fa04135ed9732286491aac46bf73b03325885737

Up resizer

view details

Artur Arseniev

commit sha 640661b0a44e5e2857b615559c1db27da3e17a6c

Avoid rendering blocks twice. Closes #3283

view details

Artur Arseniev

commit sha 8356f4cc344c06b2d9d70c9b16d51759ffef0e47

Avoid block rendering on category init. Closes #3284

view details

push time in 18 hours

pull request commentdjango/django

Schema alteration

I can help with Oracle problems if you encounter a such thing since that's my main backend I work with. (And I have to deal with all the pain it causes)

andrewgodwin

comment created time in 18 hours

pull request commentdjango/django

Fixes #32512 -- Fixed autocomplete dark theme

Ah yes, autocomplete_fields for many to many fields looks good. But it seems that the foreign key widget is different.

Fixed

mimi89999

comment created time in 18 hours