Update for latest GitHub Pages gem
This commit is contained in:
parent
fd2243bda6
commit
c6910318b5
@ -9,7 +9,7 @@ name: Gergely Polonkai
|
||||
paginate: 10
|
||||
paginate_path: "/blog/page/:num"
|
||||
exclude: ['README.md', 'Gemfile', 'Gemfile.lock', 'CNAME', ".hyde.el"]
|
||||
gems:
|
||||
plugins:
|
||||
- jekyll-gist
|
||||
- jekyll-paginate
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<span aria-hidden="true">«</span>
|
||||
</a>
|
||||
</li>
|
||||
{% for page in (1...paginator.total_pages) %}
|
||||
{% for page in (1..paginator.total_pages) %}
|
||||
<li{% if paginator.page == 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,9 +20,9 @@ feature](https://developer.gnome.org/gobject/unstable/gtype-non-instantiable.htm
|
||||
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
|
||||
[glib-mkenums](http://developer.gnome.org/gobject/stable/glib-mkenums.html)
|
||||
|
@ -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 `Makefile.am` 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](http://stackoverflow.com/a/17153598/1305139)
|
||||
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 helper.py %}
|
||||
{% gist 498a32297f39b4960ad7 helper.py %}
|
||||
|
||||
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
|
||||
needs.
|
||||
|
||||
{% 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
|
||||
solution:
|
||||
|
||||
{% 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](http://flask.pocoo.org/snippets/5/). Problem is,
|
||||
it is designed for Python 2, so I came up with a Python 3 version.
|
||||
|
||||
{% gist gergelypolonkai/1866fd363f75f4da5f86103952e387f6 slugify.py %}
|
||||
{% gist 1866fd363f75f4da5f86103952e387f6 slugify.py %}
|
||||
|
||||
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 string-checker.py %}
|
||||
{% gist 1a16a47e5a1971ca33e58bdfd88c5059 string-checker.py %}
|
||||
|
||||
The class initialization does two things: creates an empty `in_call` list
|
||||
(this will hold our primitive backtrace), and saves the filename, if
|
||||
|
Loading…
Reference in New Issue
Block a user