diff --git a/_config.yml b/_config.yml index 329b5d5..42f0d8f 100644 --- a/_config.yml +++ b/_config.yml @@ -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 diff --git a/_includes/pagination.html b/_includes/pagination.html index 4392ada..6af5ef7 100644 --- a/_includes/pagination.html +++ b/_includes/pagination.html @@ -5,7 +5,7 @@ -{% for page in (1...paginator.total_pages) %} +{% for page in (1..paginator.total_pages) %} {{page}} {% endfor %} diff --git a/_posts/2011-06-10-proxy-only-non-existing-files-with-mod-proxy-and-mod-rewrite.markdown b/_posts/2011-06-10-proxy-only-non-existing-files-with-mod-proxy-and-mod-rewrite.markdown index 537ce62..7e182de 100644 --- a/_posts/2011-06-10-proxy-only-non-existing-files-with-mod-proxy-and-mod-rewrite.markdown +++ b/_posts/2011-06-10-proxy-only-non-existing-files-with-mod-proxy-and-mod-rewrite.markdown @@ -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. diff --git a/_posts/2012-09-16-symfony-2-create-role-and-class-based-acls-with-your-roles-coming-from-the-orm.markdown b/_posts/2012-09-16-symfony-2-create-role-and-class-based-acls-with-your-roles-coming-from-the-orm.markdown index 5a72bcb..90cc643 100644 --- a/_posts/2012-09-16-symfony-2-create-role-and-class-based-acls-with-your-roles-coming-from-the-orm.markdown +++ b/_posts/2012-09-16-symfony-2-create-role-and-class-based-acls-with-your-roles-coming-from-the-orm.markdown @@ -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 diff --git a/_posts/2012-10-13-changing-the-session-cookie-s-name-in-symfony-2.markdown b/_posts/2012-10-13-changing-the-session-cookie-s-name-in-symfony-2.markdown index 1478fed..7a6b462 100644 --- a/_posts/2012-10-13-changing-the-session-cookie-s-name-in-symfony-2.markdown +++ b/_posts/2012-10-13-changing-the-session-cookie-s-name-in-symfony-2.markdown @@ -17,4 +17,4 @@ the same name. To change this, you will have to modify the `config.yml` file like this: -{% gist gergelypolonkai/c695670ecca2809f7c93 %} \ No newline at end of file +{% gist c695670ecca2809f7c93 %} diff --git a/_posts/2012-12-20-symfony-2-configuration-array-of-associative-arrays.markdown b/_posts/2012-12-20-symfony-2-configuration-array-of-associative-arrays.markdown index 2207849..a2af8ec 100644 --- a/_posts/2012-12-20-symfony-2-configuration-array-of-associative-arrays.markdown +++ b/_posts/2012-12-20-symfony-2-configuration-array-of-associative-arrays.markdown @@ -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 %} diff --git a/_posts/2013-01-06-registering-an-enum-type-in-glib-s-type-system.markdown b/_posts/2013-01-06-registering-an-enum-type-in-glib-s-type-system.markdown index 4362359..87812ce 100644 --- a/_posts/2013-01-06-registering-an-enum-type-in-glib-s-type-system.markdown +++ b/_posts/2013-01-06-registering-an-enum-type-in-glib-s-type-system.markdown @@ -20,13 +20,13 @@ 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) tool. I will read through the GLib Makefiles tomorrow for some hints on this. -Edit: you can find the glib-mkenums solution [here]({% post_url 2014-08-16-registering-an-enum-type-in-glib-glib-mkenums-magic %}). \ No newline at end of file +Edit: you can find the glib-mkenums solution [here]({% post_url 2014-08-16-registering-an-enum-type-in-glib-glib-mkenums-magic %}). diff --git a/_posts/2013-03-05-haversine-in-mysql.markdown b/_posts/2013-03-05-haversine-in-mysql.markdown index dde6afc..94a1826 100644 --- a/_posts/2013-03-05-haversine-in-mysql.markdown +++ b/_posts/2013-03-05-haversine-in-mysql.markdown @@ -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 %} \ No newline at end of file +{% gist bdad1cf2d410853bef35 %} diff --git a/_posts/2014-07-18-list-git-branches-and-their-remote-tracking-branches-side-by-side.markdown b/_posts/2014-07-18-list-git-branches-and-their-remote-tracking-branches-side-by-side.markdown index ceff04b..4f1e610 100644 --- a/_posts/2014-07-18-list-git-branches-and-their-remote-tracking-branches-side-by-side.markdown +++ b/_posts/2014-07-18-list-git-branches-and-their-remote-tracking-branches-side-by-side.markdown @@ -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! diff --git a/_posts/2014-08-16-registering-an-enum-type-in-glib-glib-mkenums-magic.markdown b/_posts/2014-08-16-registering-an-enum-type-in-glib-glib-mkenums-magic.markdown index fa25642..9f21dd3 100644 --- a/_posts/2014-08-16-registering-an-enum-type-in-glib-glib-mkenums-magic.markdown +++ b/_posts/2014-08-16-registering-an-enum-type-in-glib-glib-mkenums-magic.markdown @@ -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 %} \ No newline at end of file +{% gist 1e2fdedb136de3ca67f0 gswe-enumtypes.c %} diff --git a/_posts/2014-10-07-rounding-numbers-to-n-decimals-in-emacs.markdown b/_posts/2014-10-07-rounding-numbers-to-n-decimals-in-emacs.markdown index ad354da..9d85dc2 100644 --- a/_posts/2014-10-07-rounding-numbers-to-n-decimals-in-emacs.markdown +++ b/_posts/2014-10-07-rounding-numbers-to-n-decimals-in-emacs.markdown @@ -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 diff --git a/_posts/2015-02-26-using-git-bisect-to-find-the-first-good-commit.markdown b/_posts/2015-02-26-using-git-bisect-to-find-the-first-good-commit.markdown index acbba18..b91bd3a 100644 --- a/_posts/2015-02-26-using-git-bisect-to-find-the-first-good-commit.markdown +++ b/_posts/2015-02-26-using-git-bisect-to-find-the-first-good-commit.markdown @@ -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 %} diff --git a/_posts/2015-04-28-cross-browser-border-radius-sass-mixin-with-varargs.markdown b/_posts/2015-04-28-cross-browser-border-radius-sass-mixin-with-varargs.markdown index f581316..3b47fcb 100644 --- a/_posts/2015-04-28-cross-browser-border-radius-sass-mixin-with-varargs.markdown +++ b/_posts/2015-04-28-cross-browser-border-radius-sass-mixin-with-varargs.markdown @@ -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 %} diff --git a/_posts/2015-06-07-paramconverter-a-la-django.markdown b/_posts/2015-06-07-paramconverter-a-la-django.markdown index 91b06f4..04bcc2a 100644 --- a/_posts/2015-06-07-paramconverter-a-la-django.markdown +++ b/_posts/2015-06-07-paramconverter-a-la-django.markdown @@ -24,7 +24,7 @@ using a middleware, which may introduce performance issues sometimes[citation needed]. 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'), diff --git a/_posts/2016-01-13-emacs-implement-a-gobject-s-virtual-function.md b/_posts/2016-01-13-emacs-implement-a-gobject-s-virtual-function.md index 4ced19c..a18be49 100644 --- a/_posts/2016-01-13-emacs-implement-a-gobject-s-virtual-function.md +++ b/_posts/2016-01-13-emacs-implement-a-gobject-s-virtual-function.md @@ -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 diff --git a/_posts/2016-11-10-edit-file-as-other-user-in-emacs.md b/_posts/2016-11-10-edit-file-as-other-user-in-emacs.md index c2997d8..78c72fd 100644 --- a/_posts/2016-11-10-edit-file-as-other-user-in-emacs.md +++ b/_posts/2016-11-10-edit-file-as-other-user-in-emacs.md @@ -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 diff --git a/_posts/2016-11-18-get-passwords-from-id-manager.md b/_posts/2016-11-18-get-passwords-from-id-manager.md index c625974..f5a4eeb 100644 --- a/_posts/2016-11-18-get-passwords-from-id-manager.md +++ b/_posts/2016-11-18-get-passwords-from-id-manager.md @@ -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` diff --git a/_posts/2016-11-30-add-python-docstring-to-the-beginning-of-anything.md b/_posts/2016-11-30-add-python-docstring-to-the-beginning-of-anything.md index 4dcb057..1e54c53 100644 --- a/_posts/2016-11-30-add-python-docstring-to-the-beginning-of-anything.md +++ b/_posts/2016-11-30-add-python-docstring-to-the-beginning-of-anything.md @@ -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: diff --git a/_posts/2016-12-08-slugify-in-python3.md b/_posts/2016-12-08-slugify-in-python3.md index 45a315d..091567a 100644 --- a/_posts/2016-12-08-slugify-in-python3.md +++ b/_posts/2016-12-08-slugify-in-python3.md @@ -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. diff --git a/_posts/2016-12-22-finding-non-translated-strings-in-python-code.md b/_posts/2016-12-22-finding-non-translated-strings-in-python-code.md index 7f32019..cace971 100644 --- a/_posts/2016-12-22-finding-non-translated-strings-in-python-code.md +++ b/_posts/2016-12-22-finding-non-translated-strings-in-python-code.md @@ -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