Archive for the ‘links’ Category
do Lisp
openoffice.org Draw; insert text as curve
Actually I’m up to design a business card for myself (due to hopefully financial reasons). One idea was to create the back page as a collection of words related to my professional experience, typeset in different sizes. For this purpose I wrote a small ooo script which inserts strings as curves into the document making me able to place and rotate them after.
Sub InsertWord (oFSize As Single, oColor As Long, oText As String)
Dim oDoc As Variant
oDoc = ThisComponent
If oDoc.SupportsService("com.sun.star.drawing.DrawingDocument") Then
Dim oPage As Object
Dim oPoint As New com.sun.star.awt.Point
Dim oSize As New com.sun.star.awt.Size
Dim oTextShape As Object
oPage = oDoc.drawPages.getByName("back")
oPoint.x = 0
oPoint.y = 0
oSize.Width = 9000
oSize.Height = 5000
oTextShape = oDoc.createInstance("com.sun.star.drawing.TextShape")
oTextShape.Size = oSize
oTextShape.Position = oPoint
oPage.add(oTextShape)
oTextShape.String = oText
oTextShape.CharWeight = com.sun.star.awt.FontWeight.BOLD
oTextShape.CharFontName = "Arial"
oTextShape.CharHeight = oFSize
oTextShape.CharColor = oColor
oDocCtrl = oDoc.getCurrentController()
oDocCtrl.select( oTextShape )
oDocFrame = oDocCtrl.getFrame()
oDispatchHelper = createUnoService( "com.sun.star.frame.DispatchHelper" )
oDispatchHelper.executeDispatch( oDocFrame, ".uno:ChangeBezier", "", 0, Array() )
End If
End Sub
Related (and probably useful) links are:
pragmatic linker
I decided to maintain a page with links good to know about. It’s like a simple html page with entries like
<a href="blah">blah</a>
It’s very annoying to type the whole skeleton every time a new entry comes. Better to store only the data in a file and generate the output page with a script as advised in e.g. The Pragmatic Programmer book. I prepared two solutions like this.
login08% cat links2html.sh
( echo "<html><body>" && \
cat $1 | \
sed -e 's/^\(.*\)$/\1 \1/' | \
sed -e 's/^\([^\ ]*\)/<a href="\1">/' | \
sed -e 's/$/<\/a><br \/>/' | \
sed -e 's/>\ />/g' && \
echo "</body></html>" \
) > $1.html
login08% cat links-to-html.el
(defun links-to-html ()
(interactive)
(let ((new (generate-new-buffer "*links-to-html*"))
(lines (split-string (buffer-string) "[\n\r]+")))
(with-current-buffer new
(insert "<html><body>\n")
(dolist (l lines)
(insert "<a href=\"" l "\">" l "</a><br />\n"))
(insert "</html></body>\n"))
(switch-to-buffer new)))
login08%
wallz
I’ve never used any wallpaper on my desktop other than defaults. I search for the one and only : ) This is a nice little collection though.
where’s the source?
I removed the snippets published here. Instead I made an arch archive http://people.inf.elte.hu/szucssza/archives/kotee@elte.hu--cl. I dunno if it works due to
temp@afroid-laptop:~/tla$ tla register-archive kotee@elte.hu--cl-SOURCE \
http://people.inf.elte.hu/szucssza/archives/kotee@elte.hu--cl
temp@afroid-laptop:~/tla$ tla archives
kotee@elte.hu--cl-SOURCE
http://people.inf.elte.hu/szucssza/archives/kotee@elte.hu--cl
temp@afroid-laptop:~/tla$ tla make-archive --mirror-from kotee@elte.hu--cl-SOURCE .
/build/buildd/tla-1.3.3/src/tla/libarch/pfs-fs.c:115:botched invariant
!!uri
PANIC: exiting on botched invariant
temp@afroid-laptop:~/tla$
The files are there though.
szucssza@panda:~/public/public_html/archives$ find . ./=meta-info ./=meta-info/name ./=meta-info/mirror ./.archive-version ./cl-bf--mainline--0.1 ./cl-bf--mainline--0.1/base-0 ./cl-bf--mainline--0.1/base-0/log ./cl-bf--mainline--0.1/base-0/cl-bf--mainline--0.1--base-0.src.tar.gz ./cl-bf--mainline--0.1/base-0/checksum ./cl-bf--mainline--0.1/patch-1 ./cl-bf--mainline--0.1/patch-1/log ./cl-bf--mainline--0.1/patch-1/cl-bf--mainline--0.1--patch-1.patches.tar.gz ./cl-bf--mainline--0.1/patch-1/checksum ./cl-bf--mainline--0.1/patch-1/++revision-lock ./cl-bf--mainline--0.1/patch-1/++revision-lock/+contents szucssza@panda:~/public/public_html/archives$
old stuff
You can find it there.