手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表Tag:mamp

inotify的相关文章和资料

 应该不会消失的链接:

1、https://infoq.cn/article/inotify-linux-file-system-event-monitoring

2、http://ju.outofmemory.cn/entry/264098

3、http://icodeit.org/2015/03/build-monitor-script-based-on-inotify/ ,他有提到mac用fswatch

4、http://ju.outofmemory.cn/entry/278544 有一个现成的同步脚本

其实我5年前有写过一个inotifywait + php 的脚本,主要是用来检测哪些文件被人修改了,用做防篡改。可能最近会重新用上,温故一下旧知识点

 

简易重启mac 下的mamp pro

 简单的弄一下。因为有时候要改配置,然后打开mamp,点击重启会耗时特别长。。。。所以简单的弄了一下

XML/HTML代码
  1. #!/bin/bash  
  2.   
  3. function start(){  
  4.     /Applications/MAMP/Library/bin/httpd -f "/Library/Application Support/appsolute/MAMP PRO/conf/httpd.conf" -k start  
  5. }  
  6.   
  7. function stop(){  
  8.     /Applications/MAMP/Library/bin/httpd -f "/Library/Application Support/appsolute/MAMP PRO/conf/httpd.conf" -k stop  
  9. }  
  10.   
  11. function restart(){  
  12.    (stop)  
  13.    (start)  
  14. }  
  15.   
  16. function status(){  
  17.     ps aux|grep httpd  
  18. }  
  19.   
  20. echo "which do you want to?input the number."  
  21. echo "1. start"  
  22. echo "2. stop"  
  23. echo "3. restart"  
  24. echo "4. status"  
  25. read num  
  26.   
  27. case "$num" in  
  28. [1] ) (start);;  
  29. [2] ) (stop);;  
  30. [3] ) (restart);;  
  31. [4] ) (status);;  
  32. *) echo "exit";;  
  33. esac  
其实没啥难度就是这么几行代码。连路径都没有定义变量。但一般情况下够用了,复制不成功的,可以直接打开://neatstudio.com/mamp.txt
 

Tags: mamp

IOS开发笔记(swift)二

1、 如何获取字符串的长度:

在判断长度是否大于0的时候,if [xxx length ] > 0 就行了。而如果直接用swift,就不能写 if xxx.length > 0 了。因为xxx没有length这个方法。
有两个办法:
  1. if countElements(xxx) > 0 
  2. if xxx.utf16count > 0 
2、swift的delegate不象oc那样一个个的标注,只要在class头上写明就OK了
比如 class ViewController : UIViewController , UIActionSheetDelegate {

}
就能直接用UIActionSheetDelegate中的方法了。然后他们的delegate写self即可

刚开始学。不知道对错,目前就这样先纯做笔记,当然 你也可以delegate: nil 这样代表你这个控件 就不再接受委托了

Tags: swift