Submitted by gouki on 2015, February 27, 10:59 PM
平时的工作中,除了bootstrap,其实还是有一些其他的皮肤是可以尝试的,比如这个“http://semantic-ui.com/”,你就可以看到与bootstrap等不同的效果。
semantic-ui准备了一些常用的小效果,而且自带了一些小皮肤,比如github的效果,比如bootstrap,twitter的小效果,你在使用中会发现它的好的
不多介绍,直接去官网看吧。如果你偷懒,就用这个链接下载吧:https://github.com/Semantic-Org/Semantic-UI/archive/1.10.2.zip
官网:http://semantic-ui.com/
github: https://github.com/semantic-org/semantic-ui/
Tags: semantic, bootstrap
PHP | 评论:0
| 阅读:20676
Submitted by gouki on 2015, February 20, 9:07 PM
羊年快乐。喜气羊羊,羊羊得意!
祝能看到我勃客的人在羊年里少出BUG,多出产品。皆大欢喜!
我自己的目标和愿望就不列出来了。也期望自己能够实现新年的愿望
Misc | 评论:0
| 阅读:17361
Submitted by gouki on 2014, December 27, 11:03 AM
Yii2 的Html组件越来越觉得容易用了。而且也更方便了,不过设置默认值的时候有一点不方便。比如input的时候都是直接设置placeholder就行了
在Yii1的时候,有一个参数 :htmlOptions => array() , 在Yii2中简化到就剩一个options。。。当然 placeholder 还是可以直接用的
只是在dropdownlist的时候,placeholder就不能用了。这时候的参数是:prompt
例子:
PHP代码
- $form->field($model, 'lists')->dropDownList(Categories::findAll([1=>1]), ['prompt' => '请选择分类')])
看到那个findAll([1=>1])没。如果只是用默认的findAll,没有条件的话。不能查询,所以只有1=>1这样。
PHP | 评论:0
| 阅读:23291
Submitted by gouki on 2014, December 18, 1:19 PM
几个小问题,是在看《精通IOS开发》第六版第七章遇到的
7.8章节:使用自定议选取器创建一个简单游戏
1、P 159 书上写着:添加一个选取器视图,在选取器视图下方添加一个分页
妹啊,这个分页究竟是什么?开始以为是pagecontrol组件,但看完本章后才发现,这就是一个Label,为什么前后翻译 会不一样??
2、P159最后一段:需要取消选择View设置底部的User Interaction Enabled,这样用户就不能够手动更改刻度盘作弊了
我擦 ,我把View设置的User Interaction Enabled 的勾取消后,整个页面的button,label什么的全部没有事件了。
明明只是将pickerview的user interaction enabled的勾取消么,害我浪费了2个小时,我一直在编译、改代码就是想处理为什么我的button不能点击了,点击了之后为什么没反应
3、例程中:
XML/HTML代码
- //当然 self.images 是 NSArray
- self.images = @[[UIImage imageNamed:@"seven"] , [UIImage imageNamed:@"apple"]];
但是如果纯粹翻译成swift这是错误的

最后我改成了:
XML/HTML代码
- self.images = ["seven","bar","crown","cherry","lemon","apple"]
然后在调用的时候再创建UIImage,比如:
XML/HTML代码
- func pickerView(pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusingView view: UIView!) -> UIView {
-
- var img = self.images?[row] as String ;
- return UIImageView(image: UIImage(named: img));
- }
这也算是曲线救国吧,等下次学的深的时候再来看一下这个问题
4、声音
原文中,#import <AudioToolbox/AudioToolbox.h>在swift中就方便了,直接 import AutioToolbox
不过读取声音资源的时候也确实不一样
XML/HTML代码
- //.h
- @implementation xxxController{
- SystemSoundID xxxSoundId
- }
- //.m
- if (xxxSoundId == 0) {
- NSString *path = [[NSBundle mainBundle] pathForResource:@"xxx" ofType:@"wav"];
- NSURL *soundURL = [NSURL fileURLWithPath:path];
- AudioServicesCreateSystemSoundID((__bridge CFURLRef)soundURL , &xxxSoundId );
- }
- //然后就可以播放了
- AudioServicePlaySystemSound(xxxSoundId);
在swift中就不能这么写了。首先,没看到有(__bridge CFURLRef),经过google,我找到了这里:http://stackoverflow.com/questions/24043904/creating-and-playing-a-sound-in-swift,有很多人回答了,有人说flappyswift中有人这样用:
XML/HTML代码
- import SpriteKit
- import AVFoundation
-
- class GameScene: SKScene {
-
- // Grab the path, make sure to add it to your project!
- var coinSound = NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("coin", ofType: "wav"))
- var audioPlayer = AVAudioPlayer()
-
- // Initial setup
- override func didMoveToView(view: SKView) {
- audioPlayer = AVAudioPlayer(contentsOfURL: coinSound, error: nil)
- audioPlayer.prepareToPlay()
- }
-
- // Trigger the sound effect when the player grabs the coin
- func didBeginContact(contact: SKPhysicsContact!) {
- audioPlayer.play()
- }
-
- }
也有人提了个主意,但是说新版的xcode已经不能用了。最后有人贴了段代码:
XML/HTML代码
- import AudioToolbox
-
- let chaChingSound: SystemSoundID = createChaChingSound()
-
- class CashRegisterViewController: UIViewController {
- override func viewWillAppear(animated: Bool) {
- super.viewWillAppear(animated)
- AudioServicesPlaySystemSound(chaChingSound)
- }
- }
-
- func createChaChingSound() -> SystemSoundID {
- var soundID: SystemSoundID = 0
- let soundURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(), "Cha-Ching", "aiff", nil)
- AudioServicesCreateSystemSoundID(soundURL, &soundID)
- CFRelease(soundURL) //新版xocde已经不要这一句了,提示自动管理内存,不要你主动释放了
- return soundID
- }
嗯,我就是用的这个。
5、[sef performSelector]
标题的这个方法,在swift中已经没有了,那怎么延迟0.5秒呢?stackoverflow上也有答案:http://stackoverflow.com/questions/24170282/swift-performselector-withobject-afterdelay
最简单的就是:
XML/HTML代码
- var timer = NSTimer.scheduledTimerWithTimeInterval(0.1, target: self, selector: Selector("someSelector"), userInfo: nil, repeats: false)
-
- func someSelector() {
- // Something after a delay
- }
或者 :
XML/HTML代码
- dispatch_after(0.1, dispatch_get_main_queue(), {
- // your function here
- })
---至此,第7章全部看完。
整个第一章就一个Tabbar和pickerview加datepickerview,却有这么多的问题,而且还有一个就是pickerview中的数据怎么循环?暂时还没有仔细的了解 ,先把整本书读完试试
Flutter | 评论:0
| 阅读:18385
Submitted by gouki on 2014, November 3, 10:28 PM
不多写,就几个关键点:
wget ftp://xxx.xxx.xxxx.xxx/data/* --ftp-user=xxx --ftp-password=xxx
用于下载FTP目录
wput /var/www/xxxx ftp://user@password:/data/xxxx
上传目录,但上传的时候会有点小问题,比如有中文、或者有空格的时候,在批量上传的时候可能会失败
据说:
XML/HTML代码
- $find /home/test -type f >> ~/list.txt
- $while read i ; do wput “$i” ftp://ftpusername:password@ip/myname ; done < ~/list.txt
未测试,但看这个while do 应该可行。
纯笔记
最后附上wget拉取整站的代码:
XML/HTML代码
- wget \
- --recursive \
- --no-clobber \
- --page-requisites \
- --html-extension \
- --convert-links \
- --restrict-file-names=windows \
- --domains example.com \
- --no-parent \
- www.example.com/article/page/
可以参考一下不过对于CSS嵌套CSS中的图片可能不OK
苹果相关 | 评论:0
| 阅读:19497