??xml version="1.0" encoding="utf-8" standalone="yes"?>
打开Bundle Editor
选则Show all
选则文g?span class="hilite1" style="background-color: #ffff00;">TextMateQ或者随便你选则什么)
增加一个新的template‘openEncodedFile’Q或者随便你自己命名Q?br />
在Template data中如下设?br />
ExtensionQ中 留空
Command(s):
# open CocoaDialog’s file select menu
file=$(CocoaDialog fileselect \
--title "Open an encoded file" \
--with-directory $HOME/ \
)
# check for valid file
if [ -n "$file" ]; then
# open CocoaDialog's dropdown menu
# for more encodings add them to '--items'
# to list all possibile encodings use the Terminal with 'iconv -l'
res=$(CocoaDialog dropdown \
--title "Open an encoded file" \
--text "Choose the encoding:" \
??exit?onchange \
--button1 "Open" \
--button2 "Cancel" \
--items "BIG5" "EUC-TW" "GB2312" "SJIS" "EUC-JP" "KOI8-R" \
)
# if user canceled exit
[[ $( (tail -r <<<"$res") | tail -n1) == "2" ]] && \
exit_discard
res=$(tail -n1 <<<"$res")
# add more 'elif' according to '--items' if needed
if [ "$res" == 0 ]; then
ENC="BIG5"
elif [ "$res" == 1 ]; then
ENC="EUC-TW"
elif [ "$res" == 2 ]; then
ENC="GB2312"
elif [ "$res" == 3 ]; then
ENC="SJIS"
elif [ "$res" == 4 ]; then
ENC="EUC-JP"
elif [ "$res" == 5 ]; then
ENC="KOI8-R"
fi
# start conversion to UTF-8 and send the result as a new file back to TM
iconv -f "$ENC" -t utf-8 "$file" > "$TM_NEW_FILE"
fi
Output: Insert as Text - Activation: Key Equivalent shift+option+o (我的) - Scope: 留空
Also you may want to check out this video in the Videocasts section of the handbook: Installing a Local Web Server on Mac OS X.
(This will install Apache, MySQL, and PHP in one step.)
Find the latest version here: http://www.mamp.info/
Download and drag to Applications folder to install. Open MAMP and click "start servers," then "Open start page."
Find the latest Drupal release here: http://drupal.org/.
Move the directory containing the Drupal files into the MAMP htdocs directory:
mv drupal-x.x.x/* drupal-x.x.x/.htaccess /Applications/MAMP/htdocs/yourdrupaldir
where yourdrupaldir is whatever you want the directory to be called.
Note: if you use Finder you may miss moving the .htaccess file which is necessary for clean URLs to work. It is generally best to download and unzip Drupal directly in the document root (default is htdocs) so you don't miss the .htaccess.
To create a database for Drupal
You can also use a GUI such as Sequel Pro, just remember to use this as your Socket:
/Applications/MAMP/tmp/mysql/mysql.sock
The default username/password for your MySQL install is now root/root! For security purposes, it's always best to change this. If you're connected to the internet, this is a must.
When you are changing the default user/password from root/root, you need to do two things. Only the first is documented in the MAMP start page FAQ, but if you don't do the second then you get an error message when you try to access anything from the MAMP start page.
Open the terminal and type the following:
/Applications/MAMP/Library/bin/mysqladmin -u root -p password [NEWPASSWORD]
It will ask for the current password after you hit enter. Once you have entered that, the MySQL password is changed.
/Applications/MAMP/bin/phpMyAdmin-X.X.X/config.inc.php
Find the line that reads...
$cfg['Servers'][$i]['password'] = 'root';
...and change the value 'root'
to your new password, retaining the quotes.
/Applications/MAMP/bin/mamp/index.php
Find the line that reads...
$link = @mysql_connect(':/Applications/MAMP/tmp/mysql/mysql.sock', 'root', 'root');
...and change the last parameter to your new password.
/Applications/MAMP/bin/stopMysql.sh
Replace the -proot
with your password. (If you
don't change this one you can have zombie mysqld's running after you
thought you stopped the server)
By default, MAMP has the memory limit that a script can use set at 8MB, which is the PHP default. Looking at PHP's php.ini-recommended file, this memory limit is normally set at 128MB. To adjust this amount, open the php.ini file in a text editor and change the following line (approximately on line 232):
memory_limit = 8M ; Maximum amount of memory a script may consume (8MB)
PHP.ini file locations:
/Applications/MAMP/conf/php4/php.ini
/Applications/MAMP/conf/php5/php.ini
In MAMP PRO, don't alter the file directly since it will be recreated at each server start. Please edit the appropriate template (menu File > Edit template > ...) instead.
Even with larger PHP memory limits you can get timeout errors trying to import large Drupal databases into MySQL. These issues are discussed at length elsewhere with regards to the cache and views cache. Generally the solution is to empty the Drupal cache before importing/exporting databases to/from MySQL.
Navigate to http://localhost:8888/yourdrupaldir/install.php and fill in the installation fields using the information provided on the MAMP start page and the name you used for the database you created in step 3.
Go to http://localhost:8888/yourdrupaldir/ and create the first account.
Continue with instructions in INSTALL.txt.
If you changed your MySQL username and password you will need to modify that in your local Drupal settings.php file as well.
By default the File System settings (admin/settings/file-system) will place the temporary files directory inside /Applications/MAMP/tmp/php which should be changed to something like files/tmp or sites/files/tmp to avoid later confusion.
If you would like to shorten your URL from "http://localhost:8888" to "http://localhost" follow these instructions:
“使用哪种原型设计工具”大概是设计师闲聊时出现频率最高的话题之一。据 我了解一般以Visio和PhotoshopZQ也有h用Flash和PPTQ据一个新来的同事_(d)他们公司q用Excel。我实在想不出用Excel 怎么dQ哈哈。我个h最喜欢的工hOmniGraffleQ如 下图Q,自从我用了它以后Q就再也不想用其它原型设计Y件了?/p>
首先我必隆重介l一?a style="padding: 2px; margin: 0px; color: #336699;" target="_blank" >Omni Groupq家只有26个h的小公司Q他们h数虽,但却产出 了像OmniWeb?a style="padding: 2px; margin: 0px; color: #336699;" target="_blank" >OmniGraffle?a style="padding: 2px; margin: 0px; color: #336699;" target="_blank" >OmniPlan?a style="padding: 2px; margin: 0px; color: #336699;" target="_blank" >OmniOutliner{? {一pd深受用户Ƣ迎的精品YӞ实力l对不容觑?/p>
你可以用OmniGraffleQ以下简UOGQ来做很多事情,我一般用 它来l制程囑֒界面原型。相比较于Visio{工P它的以下特点和功能让人爱不释手:(x)
OG的界面太漂亮了,臛_比灰H突的Visio好看多了?#8220;的是? ?#8221;Q《最佌?00l则》)Q用OGl图的时候脑中常常充满灵感,而对着Visio则只惛_快把工作做完?/p>
OG的可用性做得很好,可以让一名新手很快地l制?#8220;惌一?#8221; QJobs当年评h(hun)OS X界面时的原话Q的程囑֒原型图。我使用它没多久定义了一套自q样式Q如下图Q,q在目中重用?/p>
除了官方的模板外Q?a style="padding: 2px; margin: 0px; color: #336699;" target="_blank" >Graffletopia|站提供了众多设计精的模板。不仅有常见 的网l、Y件流E、电(sh)路等cȝQ甚臌有UCD相关的模板(如下图)Q不仅显著提升工作效率,而且也得你的出物与众不同Q?/p>
Information Architecture
User-Centered Design Activities
在用Visio的时候,你有多少ơ想把多个元素的大小调成一L(fng)Q反正我 每次用它l制程囄时候都惌么做Q可每次都需要一个个的调_(d)让h无可奈何。在OG里面Q这是一件小菜一的事儿。当你调整Q何一个元素的大小 ӞOG都会(x)自动捕捉q显C页面内所有元素的大小Qƈ辅助鼠标的运动(通过性感Q,以便让这一元素的大和其它M一个你惌的元素保持一_(d)如下 图)。对于没用过OG的h来说Q这听v来可?#8220;震撼”Q我W一ơ发现这功能时激动不Ԍ此外Q保持两个或多个元素在水q_垂直方向上对齐也是轻而易丄 事:(x)辅助Ud你需要的时候出玎ͼ如下图)?/p>
辅助寸调整
辅助寚w
OGq有C清的好用的小功能Q让人感觉无时无M处在q个软g的关怀之中QMQ对于设计类软g来说QOGl对是用 户体验的典范之作?/p>
最后,很不q的是,q个软g只有Mac版。不q如果你只有PC的话Q不? 看看q里 Q)
1、下载MySQL 5.x 发行?Q解压ƈ安装映像中的两个安装包文件?/p>
a. mysql-5.x-osx10.6_x86_64.pkg Qmysql 5.x 标准版安?/p>
b. MySQLStartupItem.pkgQmysql启动目Q可以上你的?sh)脑在启动系l时自动q行mysql服务。它安装?Library /StartupItems/MySQL/Q如果你不想pȝ启动时运行mysql服务Q请不要安装。如果你在安装后又不想用,请删?Library /StartupItems/MySQL/q个目录?/p>
启动mysqlQ?/p>
2、如果你已经安装了MySQLStartupItem.pkgQ重新启动电(sh)脑即可?/p>
3、如果你有安装MySQLStartupItem.pkg或者不惛_动电(sh)脑,q行Q应用程序-实用E序Q终端程序,在终端中输入命o(h)Q?/p>
sudo /Library/StartupItems/MySQL/MySQL start
然后输入你的pȝ理员密码,如果没有讑֮密码q接回车?/p>
关闭mysql服务Q?/p>
l端中输入命令:(x)sudo /Library/StartupItems/MySQL/MySQL stop
然后输入你的pȝ理员密码,如果没有讑֮密码q接回车?/p>
mysql root账户密码Q?/p>
mysql root密码初始值是I。这栯然没有问题。但很不安全。徏议你更改root用户密码。注意:(x)mysql root用户和系l中的root用户是不一L(fng)。是完全两个不同的用戗?/p>
更改mysql root密码请在l端中输入命令:(x)
/usr/local/mysql/bin/mysqladmin -u root password 新密?/p>
同时你也可以随时使用q条命o(h)更改你的密码?/p>
4、下载x版mysql数据库管理工?/p>
q是一个运行在mac os
xpȝ中的mysql数据库管理YӞ支持本地?qing)远E数据库理。ƈ且还是免费的。这个程序的优点是完全CGI界面。ƈ且密码是保存在本Z的。相Ҏ(gu)?
安全?/p>
先看一下mac中,java链接C哪里Q?/font>
q入到相应的目录Qcd /usr/bin
查看java链接C哪里Qls -l java
localhost:bin root# ls -l java
lrwxr-xr-x 1 root wheel 74 May 18 10:26 java ->
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
可以看到javaq接Ccurrent版本。那么这个到底是什么版本呢Q其实,mac中current只是一个快h?
而已Q是Z方便讄默认java的?/font>
q个链接q到哪里Q默认的java是哪个。但是在mac中可以保持这个java链接不变Q只是改变一下当前的 java卛_Q下面是步骤Q?/font>
1Q打开Finder Q?单击桌面地步的finder图标卛_?/font>
2QApplication-->Utilities-->Java-->Java Preferences
3)q二步可以打开“Java Preferences”对话框,选中“General”tab。在下面?#8220;Java Application Runtime Settings”区把需要的java版本拖动到最端卛_?/font>
最端的java是当前QcurrentQjavaQ这样在改变默认java版本时就不用?usr/bin下重 新设|java链接Q而是直接在这里把需要的java拖到最上面p?/font>
2.MAC中的javahome讄
在windows中,javahome的值只是取到版本号的目录即可,但是在mac中有E微的不同,要去到版本号? 录下的Home目录Q如Q?/font>
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
3. 在MAC中设|JAVA_HOME环境变量
环境变量要再etc目录下的profile文g中配|,q样才是怹的配|?br />
cd /etc
vi profile
输入如下内容Q?/font>
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
export JAVA_HOME
保存。然后重启或者注销Q环境变量的配|v作用?br />
q样javahome的环境便令配|好了?/font>
同样的道理,我们可以在profileq个文g中进行PATH,CALSSPATH{环境变量的配置?/font>
To change your path, you must edit the .profile file in your home
directory. If you are comfortable using the vi editor, you probably
don’t need to read any further. If not, then you can use
TextEdit to edit your .profile.
The default .profile is fairly short. The .profile is read when you open a Terminal window and each line is executed just like typing a command into the Terminal window. While this is handy because you can make any available command run whenever you drop to a shell, we’re concerned with changing an environment variable, PATH.
In your editor, find the line that starts with export PATH= and give it a look to make sure it doesn’t already contain the directory path you’re going to add. Sometimes the PATH variable can get lengthy, but chances are yours just has a few directories separated by colons, perhaps something like this:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
There are a few things to note before making changes. The format of this line is important. The use of spaces in this command, or their lack, matters. In particular, there cannot be spaces around the equals sign or between any of the directories. If there are spaces in the directory name you want to add, you’ll need to escape the space by preceeding it with a "backslash or by putting the path in quotes (export PATH=”/path/here”).
The export= keyword in front of that line has a very specific purpose. Defining a variable without exporting it makes it available only to the current shell, not to any subsequent shells. You may think to yourself that you don’t plan to make any subsequent shells, but this happens whenever you run a shell script. If the PATH variable was not exported, when you run a shell script, the PATH would no longer exist and it is possible that the script would fail.
The $PATH at the end of the example above tacks the previous value of the variable (if it exists) onto the end of the PATH. By default, this will add ‘:/bin:/sbin:/usr/bin:/usr/sbin’ to the end of the PATH for you which is useful because most everything you run from the command line lives there.
So, to add a new directory to the path, simply add it to the existing PATH line in .profile being careful to separate it from other directories there with colons and careful not to introduce unwanted spaces (everything after the space will be ignored). For example, to add the directory /mightyq/bin to the PATH shown above, the line could become any of the following examples:
export PATH=/mightyq/bin:/opt/local/bin:/opt/local/sbin:$PATH
export PATH=/opt/local/bin:/mightyq/bin:/opt/local/sbin:$PATH
export PATH=/opt/local/bin:/opt/local/sbin:$PATH:/mightyq/bin
Note that in the third example the new directory is added to the end of the PATH. You have the ability to optimize the searches your shell will do on your behalf each time you run a command by organizing your PATH logically. Putting less frequently used or really massive directories later in the path may give you a little performance boost (although these days things are pretty fast, so you have to be a little anal to really enjoy this).
If you don’t need a directory in your path, you can reverse the process by deleting the unwanted directory still taking care to preserve the no spaces, colon separation rules.
One last note, to test the change you made, you can use the echo command, but you need to make the shell reload the .profile first. Assuming you are in your home directory (if not, running ‘cd’ without any options will take you there), run these commands:
. ./.profile
echo $PATH
The first is a neat little command in that it shows three uses or interpretations of the period in a single line. The first . is a shortcut to cause the shell to ’source’ or load the contents of the subsequent file as itself, in the manner that the shell uses when you login to a system or start a Terminal window. If you simply executed these commands like a shell script (bash .profile, for example) you would start a new shell, that shell would get the variable set, and at the end of running the .profile script, that new shell would cease to exist and the newly defined variables would be relegated to the missing sock universe.
The second period means the current working directory. It’s not compulsory in any way in this command, but it’s habit from explaining the dots to folks, so I type it all the time now. In this context, you could also use ~/.profile as ~ explicitly means your home directory.
The last dot causes the .profile to be hidden from view in a normal directory listing or Finder view. It doesn’t change the file in any other way, it just make it invisible and de-clutters your directories. To see hidden files, you can use ‘ls -a’ and you might be surprised by what you find.
When confronted with the task of editing your .profile file, there are
several options. For the seasoned veteran, editing this file is simply a
matter of dropping to a shell, editing in vi, and :wq’ing. There is
the pico editor which, for a command line editor, is a little friendlier
than vi. For the majority of users, editing a text file is warmer and
fuzzier using a GUI text editor like TextEdit.
The problem is that files starting with a period are hidden from listings in the Finder windows, so trying to find a hidden file to open using TextEdit will not get you very far. While many third party editors provide options for opening hidden files, if you don’t have one installed, you can easily open these hidden files using TextEdit which is a part of OS X.
To open your .profile file, for example, start the Terminal application (searching for ‘terminal’ using Spotlight and clicking on the Terminal application is an easy way to do this). Since Terminal will put you in your home directory by default and .profile is in your home directory, you can edit .profile simply by typing:
open .profile
If the file you want to edit is in another directory, you’ll need to cd into that directory first or specify the full path name in front of the filename.
The open command used above uses the same mechanism to open a file using a default application that the Finder does when clicking on a file. If for some reason the default application for the file you are trying to edit has changed to something that doesn’t work for editing, you can force open to use TextEdit by adding the -a option:
open -a TextEdit .profile
Make your changes to the file and save it and you’re done. One compulsory note of caution: hidden files are often hidden for a reason. They tend to hold configuration information that, if incorrectly changed, could cause one or more applications to misbehave. Tread lightly and make backups before changing.
q入NuFile的配|页面,我们可以讄在右键菜单上可以新徏哪些文g。NuFile支持 的文件类型很多,包括文本文g、Java文g、PHP和Officepd。你q可以增加新的文件类型?/p>
配置完毕后,我们?a title="http://mac.linsheng.me/?p=253" target="_blank">FinderH口中的右键菜单 中,可以新建文件了?/p>
1. 用Terminall端E序:
打开TerminalH口, 用鼠标把要获?复制的文件或文gҎ(gu)攑ֈTerminalH口? 当看到有个绿色加号出现时, 攑ּ鼠标,
文g的完整\?full path)?x)在命o(h)行显C出? q可复制_脓(chung)到其它地?
2. 用TextEdit:
打开TextEdit应用E序, 按下”shift-command-T”或在Format菜单下选Make Plain Text,
使其转换为纯文本格式. 用鼠标把要获?复制的文件或文gҎ(gu)攑ֈTextEditH口? 当看到有个绿色加号出现时, 攑ּ鼠标,
文g的完整\?full path)?x)显C出? q可复制_脓(chung)到其它地?
3. 用关联菜单插?/strong>:
比如FilePathToClipCMPlugin?a >FileUtilsCM,
都是免费?
打开“l端”Q输入以下代码:(x)
defaults write ~/Library/Preferences/com.apple.finder
AppleShowAllFiles -bool true
然后重启 Finder 卛_Q重起Finder有多U方法,最单的Ҏ(gu)是Q?/p>
同时按住Control +
Option键,然后点击Dock左边的Finder图标Q这个时候菜单最下面׃(x)出现重新打开Finder的链接。另外还可以同时按住
Option
+ Command + ESC
三键打开强制退出应用程序对话框Q在里面关闭Finder之后QFinder?x)在关闭之后自动重新打开?/p>
恢复隐藏的代码:(x)
defaults write ~/Library/Preferences/com.apple.finder
AppleShowAllFiles -bool false