summaryrefslogtreecommitdiffstats
path: root/blog
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2012-06-21 21:24:54 +0200
committerGravatar Tom Willemsen2012-06-21 21:24:54 +0200
commitc90daec5f4a91cf1041a5a61411d860ea4329ece (patch)
treecd8932e1dd5dacdc183a91b55ca4d5c7580e9d36 /blog
downloadorgweb-c90daec5f4a91cf1041a5a61411d860ea4329ece.tar.gz
orgweb-c90daec5f4a91cf1041a5a61411d860ea4329ece.zip
Initial commit
Diffstat (limited to 'blog')
-rw-r--r--blog/.gitignore2
-rw-r--r--blog/blog-2012-04-24-0052.org21
-rw-r--r--blog/blog-2012-04-24-0127.org14
-rw-r--r--blog/blog-2012-04-24-1551.org44
-rw-r--r--blog/blog-2012-05-02-2109.org41
-rw-r--r--blog/blog-2012-05-02-2136.org21
-rw-r--r--blog/blog-2012-05-02-2152.org19
-rw-r--r--blog/blog-2012-05-03-1004.org25
-rw-r--r--blog/blog-2012-05-10-0130.org25
-rw-r--r--blog/blog-2012-05-13-1041.org6
-rw-r--r--blog/blog-2012-06-03-2318.org15
-rw-r--r--blog/blog-2012-06-09-0119.org25
12 files changed, 258 insertions, 0 deletions
diff --git a/blog/.gitignore b/blog/.gitignore
new file mode 100644
index 0000000..87fa6fd
--- /dev/null
+++ b/blog/.gitignore
@@ -0,0 +1,2 @@
+unfinished
+index.org
diff --git a/blog/blog-2012-04-24-0052.org b/blog/blog-2012-04-24-0052.org
new file mode 100644
index 0000000..bc5a381
--- /dev/null
+++ b/blog/blog-2012-04-24-0052.org
@@ -0,0 +1,21 @@
+#+TITLE: A new org-blog
+#+DESCRIPTION: Going for another org blogging module
+
+I've taken it upon myself to update the ~org-blog.el~ that was written
+a long time ago. I want something other than an extra layer over some
+other system, ~org-mode~ has everything a blog needs, but it doesn't
+generate an RSS feed or a special index page.
+
+There was the ~org-blog.el~, but that uses some old functions that
+don't exist anymore, so I thought I'd try to update it.
+
+I just barely got it working, as you can see from this post. It
+generates an RSS feed, but the links don't work. It generates an index
+page, but no links to the individual pages (not that it needs it,
+really). It doesn't listen to some of the settings (toc, sections) the
+rest of the publishing projects do.
+
+I'd also like to have all posts in a single file and use things like a
+post's category and tags and such.
+
+It'll be interesting to see what else I can fix.
diff --git a/blog/blog-2012-04-24-0127.org b/blog/blog-2012-04-24-0127.org
new file mode 100644
index 0000000..4026304
--- /dev/null
+++ b/blog/blog-2012-04-24-0127.org
@@ -0,0 +1,14 @@
+#+TITLE: Quick org-blog update
+#+DESCRIPTION: just a quick update
+
+Apparently there are some things it does seem to do, and some it
+doesn't, that I didn't realize.
+
+* Generate index html
+
+ It only generates an ~index.org~ file, which it then doesn't convert
+ to HTML. That should be fixable.
+
+* Generate links
+
+ It seems to generate links correctly after all.
diff --git a/blog/blog-2012-04-24-1551.org b/blog/blog-2012-04-24-1551.org
new file mode 100644
index 0000000..3d9c7b2
--- /dev/null
+++ b/blog/blog-2012-04-24-1551.org
@@ -0,0 +1,44 @@
+#+TITLE: Silly django confusion
+#+DESCRIPTION: Think about this next time...
+
+I'm setting up a testing environment for work, using fixtures to save
+and load test data and I got a little stumped by something I ran into.
+
+I had exported one of the database tables we use to a json file that I
+was going to import into a fresh new database to test with. When I
+imported it everything seemed fine, except when looking at the actual
+page. So this is what I found:
+
+#+BEGIN_SRC sql
+SELECT * FROM app_table;
+ => 3 rows of data
+#+END_SRC
+
+#+BEGIN_SRC python
+from app.models import Table
+
+Table.objects.count()
+ => 3
+
+Table.objects.all()
+ => []
+#+END_SRC
+
+This is weird. So I looked at the ~django.db.connection.queries~
+property and I realized that it was doing a join since the model
+subclasses another:
+
+#+BEGIN_SRC python
+from django.db import models
+
+from app.models import SuperTable
+
+class Table(SuperTable):
+ field1 = models.CharField(max_lenth=200)
+#+END_SRC
+
+Which, of course, means that in order to get the complete ~Table~
+instance, the related ~SuperTable~ instance is also required, but in
+order to do a ~COUNT~ of ~app_table~ it isn't necessary. And that's
+where the inconsistency came from, now that I've also copied the
+contents of ~SuperTable~ everything is fine again.
diff --git a/blog/blog-2012-05-02-2109.org b/blog/blog-2012-05-02-2109.org
new file mode 100644
index 0000000..defa8dd
--- /dev/null
+++ b/blog/blog-2012-05-02-2109.org
@@ -0,0 +1,41 @@
+#+TITLE: Ask for selection in emacs
+#+DESCRIPTION: Something I came across
+
+I came across an email on one of the emacs mailing lists today, where
+someone asked how to ask a user for input whilst providing
+completions. The first answer he got was to try ~tmm-prompt~, so I
+looked into it a little.
+
+I use ~mu4e~ as my primary email program, but since it isn't designed
+(seemingly) for use with multiple accounts I've got some wrapper
+functions that set some variables according to my liking and then
+start ~mu4e~. This works very well, but it's a pain to have to use
+~M-x view-ryu-mail~ or ~M-x view-ninthfloor-mail~ and such, so I wrote
+a function to read a string from the minibuffer, which I then bound to
+the ~<XF86Mail>~ key, this turned it into, for example ~<XF86Mail>
+ryu~ and ~<XF86Mail> ninthfloor~ and so on, but this doesn't have any
+completion or notification of my options.
+
+So after looking at ~tmm-prompt~ I came up with the following:
+
+#+BEGIN_SRC emacs-lisp
+(defvar oni:mailbox-map
+ '(("ryulash.org" . "ryu")
+ ("ninthfloor" . "ninthfloor"))
+ "A mailbox map for use with `tmm-prompt'.")
+
+(defun view-ryu-mail ()...)
+(defun view-ninthfloor-mail ()...)
+
+(defun view-mu ()
+ (interactive)
+ (let* ((tmm-completion-prompt "Choose a mailbox\n")
+ (inbox (tmm-prompt oni:mailbox-map)))
+ (funcall (intern (concat "view-" inbox "-mail")))))
+#+END_SRC
+
+I've left out the definitions and some mail accounts for brevity.
+
+~tmm-prompt~ is usually used when using the text-mode menu with ~M-`~,
+but it works very well here too. This changes mailbox selection to,
+for example ~<XF86Mail> r~ or ~<XF86Mail> n~.
diff --git a/blog/blog-2012-05-02-2136.org b/blog/blog-2012-05-02-2136.org
new file mode 100644
index 0000000..8ea8b36
--- /dev/null
+++ b/blog/blog-2012-05-02-2136.org
@@ -0,0 +1,21 @@
+#+TITLE: Show identica icon with new dents
+#+DESCRIPTION: I kinda like it
+
+I've written this a while ago after I found out how images can be
+added to the emacs modeline. I like being notified of things that go
+on, and new dents is a good example of this, though ~notify-send~ and
+an urgency hint don't always work for that.
+
+This works:
+
+#+BEGIN_SRC emacs-lisp
+(add-to-list
+ 'global-mode-string
+ '(:eval
+ (unless (zerop identica-new-dents-count)
+ (propertize " " 'display identica-active-indicator-image))))
+#+END_SRC
+
+This will show an icon in your modeline whenever there are new dents,
+at this time there dents will not have been loaded into the buffer, so
+you'll have to refresh it, after which the icon disappears.
diff --git a/blog/blog-2012-05-02-2152.org b/blog/blog-2012-05-02-2152.org
new file mode 100644
index 0000000..1cd01a9
--- /dev/null
+++ b/blog/blog-2012-05-02-2152.org
@@ -0,0 +1,19 @@
+#+TITLE: Ask for selection in emacs, addendum
+#+DESCRIPTION: Oops, I forgot this
+
+I erroneously assumed (and thought I tested) that using ~tmm-prompt~
+could be done the way I described before. The ~oni:mailbox-map~
+variable needs to be a little different from what I'd shown before,
+namely:
+
+#+BEGIN_SRC emacs-lisp
+(defvar oni:mailbox-map
+ '("top" ("menu" ("ryulash.org" . "ryu")
+ ("ninthfloor" . "ninthfloor")
+ ("gmail" . "gmail")
+ ("aethon" . "aethon")))
+ "A mailbox map for use with `tmm-prompt'.")
+#+END_SRC
+
+Without the /top/ and /menu/ items it will complain about wrong
+arguments.
diff --git a/blog/blog-2012-05-03-1004.org b/blog/blog-2012-05-03-1004.org
new file mode 100644
index 0000000..3e10b00
--- /dev/null
+++ b/blog/blog-2012-05-03-1004.org
@@ -0,0 +1,25 @@
+#+TITLE: Another way to get a selection
+#+DESCRIPTION: Another thing I came across
+
+When I was first looking into improving my mailbox selection function
+I was looking at how to just ask the user for input with
+completions. Though now that I came across ~tmm-prompt~ I really
+prefer this way of working, at least in this case.
+
+However, today another function was mentioned, in response to someone
+pointing out ~org-completing-read~: ~completing-read~. Wow that's a
+far leap.
+
+Anyway:
+
+#+BEGIN_SRC emacs-lisp
+(completing-read "Your favorite color: "
+ '("red" "green" "blue" "yellow"))
+#+END_SRC
+
+This will ask for user input and provide these options as completions,
+but it won't show a list of options, of provide shortcuts, like
+~tmm-prompt~ does.
+
+It's good to know these things, and I really should read both the
+emacs manual and the emacs lisp reference manual at some point.
diff --git a/blog/blog-2012-05-10-0130.org b/blog/blog-2012-05-10-0130.org
new file mode 100644
index 0000000..379c20d
--- /dev/null
+++ b/blog/blog-2012-05-10-0130.org
@@ -0,0 +1,25 @@
+#+TITLE: Testing org-blog fix
+#+DESCRIPTION: Let's see if it works
+
+I've just adjusted just a little bit of code in org-blog, and now I
+want to see if it works correctly.
+
+I was getting the following error message when I would try and export
+an ~org-blog~ project:
+
+#+BEGIN_EXAMPLE
+Selecting deleted buffer
+#+END_EXAMPLE
+
+It turns out that this is because of this little piece of code:
+
+#+BEGIN_SRC emacs-lisp
+;; if buffer is already open, kill it
+(if index-buffer
+ (kill-buffer index-buffer))
+#+END_SRC
+
+I'm guessing it wasn't originally meant as a function for
+~org-publish~, well it was meant as an index function, but that
+feature seems to have changed over time. Let's see what can be made of
+it.
diff --git a/blog/blog-2012-05-13-1041.org b/blog/blog-2012-05-13-1041.org
new file mode 100644
index 0000000..0b8e87a
--- /dev/null
+++ b/blog/blog-2012-05-13-1041.org
@@ -0,0 +1,6 @@
+#+TITLE: Testing out an RSS fix
+#+DESCRIPTION: Oopsie
+
+I was working on [[http://ryuslash.org][my website]] yesterday and I noticed that the RSS feed
+doesn't generate links correctly. So I've changed it, and now I'm
+trying it out.
diff --git a/blog/blog-2012-06-03-2318.org b/blog/blog-2012-06-03-2318.org
new file mode 100644
index 0000000..a8a6b47
--- /dev/null
+++ b/blog/blog-2012-06-03-2318.org
@@ -0,0 +1,15 @@
+#+TITLE: Website update
+
+As you can [[http://ryuslash.org][see]] I finally updated my website again. It's the same basic
+idea as before, except this time I try to make the posts look more
+lisp-y, since I'm writing a lot more ~emacs-lisp~ as of late I've
+grown fond of all the parentheses.
+
+I've also moved my [[http://org.ryuslash.org][static website]] from ninthfloor to my own domain in
+the hopes it will become more a part of my website than it was before,
+although the beauty of static websites generated by things like
+~org-mode~, ~jekyll~ and such is of course that they can pretty much
+be placed on any public web space, and they're fast.
+
+Anyway, perhaps I'll post more, but for now I'm happy to have changed
+things a little again.
diff --git a/blog/blog-2012-06-09-0119.org b/blog/blog-2012-06-09-0119.org
new file mode 100644
index 0000000..8373a65
--- /dev/null
+++ b/blog/blog-2012-06-09-0119.org
@@ -0,0 +1,25 @@
+#+TITLE: Literate emacs init
+
+A little while back I saw [[http://sachachua.com/blog/2012/05/where-i-am-in-terms-of-emacs/][Sacha Chua]] mention using ~org-mode~ for
+literate programming. I'd heard of literate programming, but its use
+escaped me. Still, reading that and looking at what ~noweb~ is I
+started thinking that it would indeed be a great way of documenting
+code, especially something my emacs init file, since that is not a
+serious software project ans some weird stuff goes on in there.
+
+I still didn't really get the hang of it. It seemed like a lot of work
+to get into it and how exactly it fit together with using ~org-mode~
+didn't really hit me so I pushed it aside for the moment.
+
+Today I see her [[http://sachachua.com/blog/2012/06/literate-programming-emacs-configuration-file/][presenting]] her new literately programming init file
+with some links to other resources and I just had to try it too.
+
+I haven't gotten very far yet, but what I have so far I have put
+[[http://ryuslash.org/inittest.html][here]]. It's just the generated HTML file, no org source, and I'm still
+messing around with the colors and stuff, but it's fun to see the
+result already.
+
+I don't know if I'm actually going to use it, since my init file's
+sloc count is 1038 and its total line count is 1280 lines I fear that
+adding even more documentation (= lines) would make my init file
+*very* bulky. It is still fun to see and experiment with, though.