The SSH host key has changed on 8 April, 2022 to this one: SHA256:573uTBSeh74kvOo0HJXi5ijdzRm8me27suzNEDlGyrQ

Update for latest GitHub Pages gem

Gergely Polonkai 5 years ago
parent fd2243bda6
commit c6910318b5
  1. 2
  2. 2
  3. 2
  4. 6
  5. 2
  6. 4
  7. 6
  8. 2
  9. 2
  10. 6
  11. 2
  12. 2
  13. 2
  14. 2
  15. 2
  16. 2
  17. 2
  18. 2
  19. 2
  20. 2

@ -9,7 +9,7 @@ name: Gergely Polonkai
paginate: 10
paginate_path: "/blog/page/:num"
exclude: ['', 'Gemfile', 'Gemfile.lock', 'CNAME', ".hyde.el"]
- jekyll-gist
- jekyll-paginate

@ -5,7 +5,7 @@
<span aria-hidden="true">&laquo;</span>
{% for page in (1...paginator.total_pages) %}
{% for page in (1..paginator.total_pages) %}
<li{% if == page %} class="active"{% endif %}><a href="{% if page == 1 %}{{'/blog' | prepend: site.baseurl}}{% else %}{{site.paginate_path | prepend: site.baseurl | replace: '//', '/' | replace: ':num', page}}{% endif %}">{{page}}</a></li>
{% endfor %}
<li{% if paginator.next_page == null %} class="disabled"{% endif %}>

@ -17,6 +17,6 @@ hosting the page yet. Until we get it in our hands, I did a trick.
I enabled `mod_rewrite`, `mod_proxy` and `mod_proxy_http`, then added the following
lines to my apache config:
{% gist gergelypolonkai/47680bfa44eb29708f20 %}
{% gist 47680bfa44eb29708f20 redirect-non-existing.conf %}
I’m not totally sure it’s actually secure, but it works for now.

@ -24,7 +24,7 @@ own role hierarchy service that implements `RoleHierarchyInterface`.
So far so good, first tests. It soon turned out that if `User::getRoles()`
returns a `DoctrineCollection` as it does by default, then the standard
{% gist gergelypolonkai/883ace4f35e440f6fe0f WhatEver.php %}
{% gist 883ace4f35e440f6fe0f WhatEver.php %}
doesn’t work. I know, it should not be hard coded, as my roles and permission
tables are dynamic, I have just tested. So I fixed my `User` entity so
@ -35,12 +35,12 @@ return the original collection, but I think it will never be used.
After that, I had to implement some more features so I put this task away.
Then, I tried to create my first ACL.
{% gist gergelypolonkai/883ace4f35e440f6fe0f WhatEver2.php %}
{% gist 883ace4f35e440f6fe0f WhatEver2.php %}
I was about to check if the user who is logged in has an `OWNER` permission on
the `User` class.
{% gist gergelypolonkai/883ace4f35e440f6fe0f WhatEver3.php %}
{% gist 883ace4f35e440f6fe0f WhatEver3.php %}
The ACL was defined based on a role, so everyone who had the `ROLE_ADMIN` role
should gain access to the user listing page. But they didn’t. It took several

@ -17,4 +17,4 @@ the same name.
To change this, you will have to modify the `config.yml` file like this:
{% gist gergelypolonkai/c695670ecca2809f7c93 %}
{% gist c695670ecca2809f7c93 %}

@ -13,10 +13,10 @@ author:
Few days ago I have struggled with a problem using Symfony2 configuration. I
wanted to add the following kind of configuration to `config.yml`:
{% gist gergelypolonkai/30440e25f7a447730064 config.yml %}
{% gist 30440e25f7a447730064 config.yml %}
The problem was that the stuff under `transitions` is dynamic, so those
`hc_cba` and `cba_hc` tags can be pretty much anything. After hitting many
errors, I came to the solution:
{% gist gergelypolonkai/30440e25f7a447730064 DynarrayConfiguration.php %}
{% gist 30440e25f7a447730064 DynarrayConfiguration.php %}

@ -20,13 +20,13 @@ feature](
obvious. Making the long story short, I have checked with the `GIO` sources for
an example, and using that, I have created this small, working chunk:
{% gist gergelypolonkai/47794b6fb94484f8160b client-state.h %}
{% gist 47794b6fb94484f8160b client-state.h %}
{% gist gergelypolonkai/47794b6fb94484f8160b client-state.c %}
{% gist 47794b6fb94484f8160b client-state.c %}
Still, it can be made more perfect by using the
tool. I will read through the GLib Makefiles tomorrow for some hints on
Edit: you can find the glib-mkenums solution [here]({% post_url 2014-08-16-registering-an-enum-type-in-glib-glib-mkenums-magic %}).
Edit: you can find the glib-mkenums solution [here]({% post_url 2014-08-16-registering-an-enum-type-in-glib-glib-mkenums-magic %}).

@ -14,4 +14,4 @@ Just insert it in your database, feed them two Google coordinates, and you get
the distance in kilometres. If you happen to need it in miles, change the
constant `12756.200` in the `RETURN` row to `7922.6` instead.
{% gist gergelypolonkai/bdad1cf2d410853bef35 %}
{% gist bdad1cf2d410853bef35 %}

@ -20,7 +20,7 @@ does the work for me. Its only requirements are git (of course), and the
`column` command, which is pretty obviously present on every POSIX
compliant systems (even OSX).
{% gist gergelypolonkai/8af6a3e86b57dd4c250e %}
{% gist 8af6a3e86b57dd4c250e %}
I just put it in my path, and `git branches-with-remotes` does the work!

@ -20,7 +20,7 @@ In my other project,
method. The following two rules in `` create `gswe-enumtypes.h`
and `gswe-enumtypes.c`.
{% gist gergelypolonkai/1e2fdedb136de3ca67f0 Makefile %}
{% gist 1e2fdedb136de3ca67f0 Makefile %}
`$(GLIB_MKENUMS)` is set in `configure` with
`AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums])`.
@ -31,6 +31,6 @@ files, one for the header and one for the code. `$(gswe_enum_headers)`
contains a list of all the header files that have enum types defined
throughout the project.
{% gist gergelypolonkai/1e2fdedb136de3ca67f0 gswe-enumtypes.h %}
{% gist 1e2fdedb136de3ca67f0 gswe-enumtypes.h %}
{% gist gergelypolonkai/1e2fdedb136de3ca67f0 gswe-enumtypes.c %}
{% gist 1e2fdedb136de3ca67f0 gswe-enumtypes.c %}

@ -16,7 +16,7 @@ displayed in small size, so this amount of precision was irrelevant, and
these numbers took almost half of my SVG images’ size. So I created an
Elisp defun to round these numbers to 2 decimals:
{% gist gergelypolonkai/9c721ceda6d3079b4f05 %}
{% gist 9c721ceda6d3079b4f05 %}
This finds the first digit of the number under point (the cursor), and
reduces its digits to the given amount (or the number given with `C-u`). It

@ -43,4 +43,4 @@ his local repository with the same technique).
[This StackOverflow answer](
suggests the very same, but with some aliases:
{% gist gergelypolonkai/a98f4aab84659d60364e %}
{% gist a98f4aab84659d60364e %}

@ -29,4 +29,4 @@ could not start specifically with the `top` side. I decided to go with
the top right corner for the first parameter, while trying to keep a
sane repeating pattern. Here is the result:
{% gist gergelypolonkai/313b227434ecc5d85d7b border-radius.sass %}
{% gist 313b227434ecc5d85d7b border-radius.sass %}

@ -24,7 +24,7 @@ using a middleware, which may introduce performance issues
sometimes<sup>[citation needed]</sup>. So I decided to go with decorators, and
at the end, I came up with this:
{% gist gergelypolonkai/498a32297f39b4960ad7 %}
{% gist 498a32297f39b4960ad7 %}
Now I can decorate my views, either class or function based, with
`@convert_params(User, (Article, 'aid'), (Paragraph, None, 'pid'),

@ -44,7 +44,7 @@ line and an actual function header for `i_foo_bar` with the same
parameters. That’s a cumbersome job for more than 40 function
headers. But emacs comes to the rescue!
{% gist gergelypolonkai/bfd36be8b515edced3d2 implement-gobject-vfunc.el %}
{% gist bfd36be8b515edced3d2 implement-gobject-vfunc.el %}
Now all I have to do is to copy the whole vtable entry into
`matrix_http_api_matrix_api_init()`, execute `M-x

@ -16,7 +16,7 @@ Bozhidar Batsov on opening the current file as root. I barely use
I almost never use root as the target user. So I decided to fix it for my
{% gist gergelypolonkai/192c83aa0556d5cdaf4018f57b75a84b %}
{% gist 192c83aa0556d5cdaf4018f57b75a84b %}
If the user is not specified, the default is still root. Also, if the
current buffer is not visiting a file, I prompt for a filename. As I’m not

@ -21,7 +21,7 @@ retrieving them for your own eyes. But it cannot retrieve account data
programatically. Taking a look into its source code, I came up with this
{% gist gergelypolonkai/8bad70502ac563864080f754fce726c3 idm.el %}
{% gist 8bad70502ac563864080f754fce726c3 idm.el %}
I currently need only the account ID (ie. the username) and the password,
but it’s pretty easy to add a macro to get the `memo` or `update-time`

@ -31,7 +31,7 @@ Since I use Emacs for pretty much everything coding-related (and many more,
but that’s the topic of a different post), I wrote a small function to do it
for me.
{% gist gergelypolonkai/7b062a00d3b8a2555024521273cecfee python-docstring.el %}
{% gist 7b062a00d3b8a2555024521273cecfee python-docstring.el %}
There are still a lot of things to improve:

@ -14,7 +14,7 @@ a string). I went Googling a bit, and found an
excellend [Flask snippet]( Problem is,
it is designed for Python 2, so I came up with a Python 3 version.
{% gist gergelypolonkai/1866fd363f75f4da5f86103952e387f6 %}
{% gist 1866fd363f75f4da5f86103952e387f6 %}
As I don’t really like the transliteration done in the first example
(e.g. converting ü to ue), I went with the second example.

@ -38,7 +38,7 @@ will be invoked for every string it finds.
Before getting into the details, let’s me present you the code I made:
{% gist gergelypolonkai/1a16a47e5a1971ca33e58bdfd88c5059 %}
{% gist 1a16a47e5a1971ca33e58bdfd88c5059 %}
The class initialization does two things: creates an empty `in_call` list
(this will hold our primitive backtrace), and saves the filename, if