学习笔记

在Leoapard上跑GIMP



对于我等不常用图片编辑软件而又么的闲钱的人来说, photoshop实在是太奢侈了, 而近来越来越不想用那些所谓Crack的软件, 所以...

幸好我们有GIMP, 以前在Linux上常用的东西, 而熟悉的人也知道它和GTK的渊源

不多废话了. Leopard默认是有安装X11 (跑GIMP必备, 10.5之前版本需要自行安装), 可是我这里GIMP却一直没能跑得起来. Google了一下发现也不是我一个人遇到这种问题

解决方法就是写个AppleScript来跑Gimp, 不过这位仁兄的script在我这里需要修改一下:



至此.

碎碎念: 上周五下班回家没带伞, 在瓢泼大雨里淋了一刻钟, 第二天如期感冒. 第三天莫名其妙的收到一封来自某大学同学的mail, 讲了我三点:

1. 热衷于删她的留言 (#$&%$#%'$%&%"#$% 冤死了我...除了卖药的spam我就没删过其他留言...)
2. 做事不清不楚
3. 每次在我blog里看到的都是不愉快的东西

...

我招谁惹谁了我
---

支持utf8的php字符串截取函数

做PHP开发必然会遇到的问题吧, 前两天做那个 最新留言 插件的时候写了一个. 参考 Wikipedia utf-8为变长编码, 编码规则如下:

Binary Hexadecimal Decimal Width
00000000-01111111 00-7F 0-127 1 byte
11000010-11011111 C2-DF 194-223 2 bytes
11100000-11101111 E0-EF 224-239 3 bytes
11110000-11110100 F0-F4 240-244 4 bytes

多于1个byte的,后续字节都在80–BF之间

实现就很简单了, 利用正则表达式把字符一一分开存储到数组里, 然后要多少取多少就行

---

wyn_recent_comments 0.1 Release

一直觉得 Textpattern 自带的那个最新留言的tag比较弱, 只能显示作者和文章标题, 不过也凑合用了

昨天 dimlau提到 了这个问题, 于是…无聊之中又出现了一个新的插件

功能比自带的那个稍微强一点点, 可以显示评论内容, 支持字符串截取, 支持内容格式定制以及链接的title属性以及时间格式的定制, 当然数目限制和section限制也是必不可少的

直接下载点 这里

————华丽的分割线————

Description

Fine, textpattern has already provided a recent comments tag. But someone love it and someone hate it. And it indeed is not so powerful enough. So, this thing was born.

Usage

  1. class: css class, default is wyn_recent_comments
  2. wraptag: tag of wrap, default is ul
  3. break: tag of every item, default is li
  4. label: title label, default is nothing
  5. labeltag: tag of title, default is nothing
  6. limit: number of comments to show, default is 10
  7. wordcount: the length of each comment. The comment whose length is longer than this value, it will be cut off, with UTF-8 support. default is 10
  8. messagebreak: if a comment has been cut off, this value will be showed after it. default is ‘…’
  9. format: the things to show. you can customize it by using tags (%content% for comment content, %commenter% for commenter name, %time% for comment time and %title% for post title). default is %content%
  10. atitle: the title attribute of generated a links. tags can also be used here. default is %commenter% on %time%
  11. section: limit the comments into one section
  12. timeformat: the format of time. it uses standard PHP time format, you can refer PHP doc to know more. default is ‘%d %b %Y · %X’, a little difficult :D

Download HERE

---

wyn_email_publish 0.2 Release

很久之前做了一个 版本 , 不过很简陋, 邮件地址和内容都要手工修改插件才行, 于是重新翻新的一遍, 加入了后台控制面板, 可以自定义多个邮件地址, 甚至可以定义邮件的标题和内容.

至于为什么有这么个插件, 无非就是为了发post的时候同时发到别的BSP上, 例如blogger, live space之类

直接下载点 这里

——————————————华丽的分割线——————————————

wyn_email_publish

Description

When you publish a new post, this plugin will mail it to everywhere (email address of course :D) you want.

That means, you can publish the post onto other BSPs, which support email publish feature (like live space, or blogger), just as the same time you publish on textpattern.

History

  • 0.2: Add admin config panel, you can not only set the email addresses here, but also customize the content of mail
  • 0.1: Initialize Release, just has basal function, a little troublesome to use

Usage

  1. Install and active it, and of course, set up your email publish function of your BSPs
  2. Go to extenstion -> Email Publish
  3. Now you can set the mail address, use ‘;’ to separator if you have more than one address
  4. Set the title and body of mail, you can use the tag title, body, author and link to replace the title
    , the content, the author name and the link of the article. (NOTICE: link and body are NOT allowed in mail title)
  5. Go to write a new post to introduce this little thing :D

Download HERE

---

Textpattern Comment SOFA (TXP沙发党)

嗯, 昨天晚上无聊, 花了三个小时实现了一个雏形, 实现了对留言者统计并输出, 支持生成列表或者cloud

今天又修修补补加了用来识别用户的keyword属性, 并支持skip列表, 称之为0.2版本

后来觉得没有准确的统计沙发, 有点和名字不符, 于是又新增了restricted模式, 用来精确计算沙发党, 当然还是同时支持cloud输出和list输出. 并同时修改到0.3版本

cloud的效果如下, 喜欢的就拿去用好了

点这里 下载

—————————————-华丽的分割线—————————————-

Comment Sofa plugin for Textpattern

It can generate a cloud or a list for commenters who commented the most. OR generate them for users who got the sofa (first comment to a post) most :D

History

  • 0.3 : Add Restrict SOFA mode, which generator a cloud or a list for the users who got sofa (the first one who comment to a post) most.
  • 0.2 : Add keyword attribute to identify user by name or email and get skip value accepted a list with ‘;’ delimited.
  • 0.1 : Initialize Release

Usage

  1. wyn_comment_sofa_cloud
    • wraptag: wrap your cloud with a tag
    • keyword: The keyword to identify user, available values are name and email, default is name
    • skip: skip the user by indicated thing, default is nothing (lots of blogs just have one admin user to do everything :D) You can set values more than one, just use a ‘;’ to separate.
    • label: the label
    • labeltag: tag of the label
    • limit: the limit of commenters, default is 10
    • class: the class of wrap
    • maxsize / minsize: the max / min font size of the most / least commenter’s link. (Percent, default is 200 and 50)
    • break: the break between links, default is a space
    • showcount: whether to show the count of comments by each commenter, default is 1
    • restricted: whether to get RESTRICTED SOFA MODE (Generate cloud by rank of first commented to posts), default is 0
  2. wyn_comment_sofa_list
    • wraptag: wrap your list with a tag
    • keyword: The keyword to identify user, available values are name and email and default is name
    • skip: skip the user by indicated thing, default is nothing (lots of blogs just have one admin user to do everything :D)
    • label: the label
    • labeltag: tag of the label
    • limit: the limit of commenters, default is 10
    • class: the class of wrap
    • break: the break between links, default is a space
    • showcount: whether to show the count of comments by each commenter, default is 1
    • restricted: whether to get RESTRICTED SOFA MODE (Generate list by rank of first commented to posts), default is 0

Download from HERE

---