This commit is contained in:
parent
4e52bd273c
commit
1716d2f6cc
|
@ -1,19 +1,17 @@
|
|||
---
|
||||
date: 2015-04-01T02:24:16+02:00
|
||||
title: From Django to Hugo
|
||||
tags:
|
||||
- django
|
||||
- git
|
||||
- hugo
|
||||
- mercurial
|
||||
---
|
||||
+++
|
||||
date = 2015-04-01T02:24:16+02:00
|
||||
title = "From Django to Hugo"
|
||||
aliases = ["blog/2015/04/01/from-django-to-hugo"]
|
||||
[taxonomies]
|
||||
tags = ["django", "git", "hugo", "mercurial"]
|
||||
+++
|
||||
|
||||
About eight years ago I [wrote my own blog]({{< relref "blog/my-blog-django.md" >}})
|
||||
About eight years ago I [wrote my own blog](@/blog/my-blog-django.md)
|
||||
(and my website) using [Django](http://www.djangoproject.com/). It was time to
|
||||
change so I completely rewrote it with [Hugo](http://gohugo.io/), a static
|
||||
website engine made by [spf13](http://spf13.com).
|
||||
|
||||
## Why going static? ##
|
||||
## Why going static?
|
||||
|
||||
I use this site mainly to write about stuff I think interesting and when I have
|
||||
to write I want to use [Vim](http://www.vim.org/). So while Django is a
|
||||
|
@ -26,7 +24,7 @@ with a Vim plugin, but a markdown file for each post is easier! :)
|
|||
You can find the code of the site on [GitHub](https://github.com/eriol/mornie.org)
|
||||
and [GitLab](https://gitlab.com/eriol/mornie.org).
|
||||
|
||||
## Git? ##
|
||||
## Git?
|
||||
|
||||
It's clear by now who won the DVCS war, so I started to use git and I will
|
||||
migrate my repositories soon (I already started the migration). My plan is to
|
||||
|
@ -34,7 +32,7 @@ keep my code both on [Bitbucket](https://bitbucket.org/eriol),
|
|||
[GitHub](https://github.com/eriol) and [GitLab](https://gitlab.com/u/eriol):
|
||||
since git is distributed, I will use it in the proper way.
|
||||
|
||||
## Still a Work In Progress ##
|
||||
## Still a Work In Progress
|
||||
|
||||
No, this site is not completed yet, even an about page is missing! I
|
||||
will add more content on my spare time, so stay tuned! :)
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
---
|
||||
date: 2007-08-02T03:11:49+01:00
|
||||
title: Generating Maze using Python
|
||||
aliases:
|
||||
- /blog/2007/08/02/Generating-Maze-using-Python/
|
||||
---
|
||||
+++
|
||||
date = 2007-08-02T03:11:49+01:00
|
||||
title = "Generating Maze using Python"
|
||||
aliases = [
|
||||
"blog/2007/08/02/Generating-Maze-using-Python",
|
||||
"blog/2007/08/02/generating-maze-using-python"
|
||||
]
|
||||
[taxonomies]
|
||||
tags = ["python"]
|
||||
+++
|
||||
|
||||
Do you like mazes?
|
||||
|
||||
|
@ -24,12 +28,13 @@ eriol@mornie:~$ python maze.py
|
|||
+--+--+--+--+--+--+--+--+--+--+
|
||||
```
|
||||
|
||||
After reading this [good](http://www.mazeworks.com/mazegen/mazetut/) article, I
|
||||
decided to wrote some code to generate perfect maze. :D
|
||||
After reading this [good][mazeworks] article, I decided to wrote some code to
|
||||
generate perfect maze. :D
|
||||
|
||||
The result is here: [maze.py](http://hg.mornie.org/misc/raw-file/d67087567943/maze.py).
|
||||
The result is here:
|
||||
[maze.py](https://noa.mornie.org/eriol/misc/src/branch/main/maze.py).
|
||||
|
||||
As you can see, [Depth-First Search](http://en.wikipedia.org/wiki/Depth-first_search)
|
||||
As you can see, [Depth-First Search](https://en.wikipedia.org/wiki/Depth-first_search)
|
||||
is not a complex algorithm:
|
||||
|
||||
```python
|
||||
|
@ -46,3 +51,5 @@ def create(self):
|
|||
else:
|
||||
self.current_cell = cell_stack.pop()
|
||||
```
|
||||
|
||||
[mazeworks]: https://web.archive.org/web/20071212193445/http://www.mazeworks.com/mazegen/mazetut/
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
---
|
||||
date: 2008-03-30T03:08:16+01:00
|
||||
title: A GPL Snowman
|
||||
---
|
||||
+++
|
||||
date = 2008-03-30T03:08:16+01:00
|
||||
title = "A GPL Snowman"
|
||||
aliases = ["blog/2008/03/30/gpl-snowman"]
|
||||
+++
|
||||
|
||||
![GPL Snowman](https://farm3.static.flickr.com/2286/2371828545_e072c91734.jpg)
|
||||
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
---
|
||||
date: 2012-12-22T16:22:54+01:00
|
||||
title: How to fix CKEditor 4 default theme in Django admin
|
||||
tags:
|
||||
- admin
|
||||
- ckeditor4
|
||||
- django
|
||||
- python
|
||||
---
|
||||
+++
|
||||
date = 2012-12-22T16:22:54+01:00
|
||||
title = "How to fix CKEditor 4 default theme in Django admin"
|
||||
aliases = ["blog/2012/12/22/how-fix-ckeditor-4-default-theme-django-admin"]
|
||||
[taxonomies]
|
||||
tags = ["admin", "ckeditor4", "django", "python"]
|
||||
+++
|
||||
|
||||
[CKEditor](http://ckeditor.com/) 4 default theme, [Moono](http://ckeditor.com/addon/moono),
|
||||
[CKEditor](https://ckeditor.com/) 4 default theme, [mOOno](https://ckeditor.com/cke4/addon/moono),
|
||||
is very nice and has a good set of features:
|
||||
|
||||
* neutral design that fits all situations;
|
||||
|
@ -19,7 +17,7 @@ is very nice and has a good set of features:
|
|||
|
||||
But inside Django admin there is a little layout problem:
|
||||
|
||||
{{< figure src="/media/blog/moono-without-fix.png" alt="moono without fix" >}}
|
||||
![image of moono without fix](/media/blog/moono-without-fix.png)
|
||||
|
||||
To fix this issue you may use the following css snippet:
|
||||
|
||||
|
@ -33,5 +31,4 @@ div>.cke_chrome {
|
|||
|
||||
The result is this:
|
||||
|
||||
|
||||
{{< figure src="/media/blog/moono-with-fix.png" alt="moono with fix" >}}
|
||||
![image of moono with fix](/media/blog/moono-with-fix.png)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
date: 2007-12-06T16:39:32+01:00
|
||||
title: How to fly? import antigravity
|
||||
---
|
||||
+++
|
||||
date = 2007-12-06T16:39:32+01:00
|
||||
title = "How to fly? import antigravity"
|
||||
aliases = ["blog/2007/12/06/how-fly-import-antigravity"]
|
||||
+++
|
||||
|
||||
[xkcd](https://xkcd.com/353/) **is** great!
|
||||
|
|
|
@ -1,16 +1,15 @@
|
|||
---
|
||||
date: 2013-11-06T19:55:04+01:00
|
||||
title: How to load an image from memory in Kivy
|
||||
tags:
|
||||
- image
|
||||
- kivy
|
||||
- python
|
||||
---
|
||||
+++
|
||||
date = 2013-11-06T19:55:04+01:00
|
||||
title = "How to load an image from memory in Kivy"
|
||||
aliases = ["blog/2013/11/06/how-load-image-memory-kivy"]
|
||||
[taxonomies]
|
||||
tags = ["image", "kivy", "python"]
|
||||
+++
|
||||
|
||||
Sometime you may have the need to load an image already in memory instead of
|
||||
use one of the several ways [Kivy](http://kivy.org/) provides to load images.
|
||||
use one of the several ways [Kivy](https://kivy.org/) provides to load images.
|
||||
|
||||
{{< figure src="/media/blog/kivy_memory_image.png" alt="kivy memory image" >}}
|
||||
![kivy memory image](/media/blog/kivy_memory_image.png)
|
||||
|
||||
I had this need for a project of mine so I came up with the following code (I
|
||||
was inspired by [this thread](https://groups.google.com/forum/#!topic/kivy-users/l-3FJ2mA3qI)).
|
||||
|
@ -104,9 +103,9 @@ if __name__ == '__main__':
|
|||
`cardioid`, `polar_plot` and `fig2png` are simply support functions to simulate
|
||||
an image already loaded in memory. My actual use case is different: I have
|
||||
images as BLOB inside a SQLite database (just like I described
|
||||
[years ago](/blog/2007/01/10/storing-binary-data-in-sqlite/)). The real work is
|
||||
[years ago](@/blog/storing-binary-data-in-sqlite.md)). The real work is
|
||||
done by `MemoryImage`'s `on_memory_data` method, taking advantage of Kivy
|
||||
automatic property binding.
|
||||
|
||||
You can download the whole example from here:
|
||||
[kivy_memory_image.py](http://hg.mornie.org/misc/raw-file/tip/blog/kivy_memory_image.py).
|
||||
[kivy_memory_image.py](https://noa.mornie.org/eriol/misc/raw/branch/main/blog/kivy_memory_image.py).
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
+++
|
||||
date = "2006-12-28T03:06:00+01:00"
|
||||
title = "Libero SMTP pain :("
|
||||
aliases = ["blog/2006/12/28/libero-smtp-pain"]
|
||||
+++
|
||||
|
||||
Since few days the SMTP server of my [ISP](http://internet.libero.it/) has
|
||||
|
|
Loading…
Reference in a new issue