This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 一个scrollview上有几个按钮 | |
| 在scrollview上add 了一个单击事件 | |
| singletap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)]; | |
| [singletap setNumberOfTapsRequired:1]; | |
| [scrollview addGestureRecognizer:singletap]; | |
| 这样点击按钮,不会响应按钮的事件,直接跳到handleSingleTap去了? | |
| 单击事件不是应该先被直接单击的subview处理,如果没有处理才提交到supview处理嘛? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var dburl = 'localhost/mongoapp'; | |
| var collections = ['users']; | |
| var db = require('mongojs').connect(dburl,collections); | |
| db.users.save({ | |
| name: 'hello', | |
| email: 'hello@world.com' | |
| }); | |
| db.users.find({},function (err, users) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # A quick and dirty implementation of an HTTP proxy server in Ruby | |
| # because I did not want to install anything. | |
| # | |
| # Copyright (C) 2009 Torsten Becker <torsten.becker@gmail.com> | |
| require 'socket' | |
| require 'uri' | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'zip/zip' | |
| require 'plist4r' | |
| Zip::ZipFile.open('/tmp/weipass.ipa',Zip::ZipFile::CREATE) { |zipfile| | |
| plist_string = zipfile.read("Payload/MicroPass.app/Info.plist") | |
| p = Plist4r::Plist.new({ :from_string => plist_string }) | |
| puts p["CFBundleDisplayName"] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # usage: _rvmruby <ruby version> [ruby arguments] | |
| if [[ -s ~/.rvm/scripts/rvm ]]; then | |
| . ~/.rvm/scripts/rvm | |
| fi | |
| ruby_version=$1; shift | |
| rvm $ruby_version | |
| exec ruby "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>org.ruby-china.rnotice</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>这里写_rvmruby路径</string> | |
| <string>这里写rvm的gemset ,如1.9.3@temp</string> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ./configure --with-features=huge --disable-largefile \ | |
| --enable-perlinterp --enable-pythoninterp \ | |
| --enable-rubyinterp --enable-gui=gtk2 \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @interface UIClickView : UIView | |
| @property (nonatomic,assign)UITextField* edit; | |
| @end | |
| @implementation UIClickView | |
| - (UIView*)hitTest:(CGPoint)point withEvent:(UIEvent *)event { | |
| CGPoint p = [self convertPoint:point toView:self.edit]; | |
| if (p.x>0 && p.y>0) { | |
| return nil; | |
| } | |
| return [super hitTest:point withEvent:event]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)textFieldDidBeginEditing:(UITextField *)textField { | |
| [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; | |
| UIView *mainV = [self getMainView]; | |
| clickV = [[UIClickView alloc]initWithFrame:mainV.bounds]; | |
| clickV.edit = input; | |
| [mainV addSubview:clickV]; | |
| [clickV release]; | |
| [self becomeFirstResponder]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -(void) keyboardWillShow:(NSNotification*)notification { | |
| NSDictionary* info =[notification userInfo]; | |
| kbSize =[[info objectForKey:UIKeyboardFrameEndUserInfoKey]CGRectValue].size; | |
| UIView *mainV = [self getMainView]; | |
| CGPoint p =[self convertPoint:CGPointMake(0, self.frame.size.height) toView:mainV]; | |
| if (p.y + kbSize.height > mainV.frame.size.height) { | |
| [UIView beginAnimations:@"" context:nil]; | |
| [UIView setAnimationCurve:0.3]; | |
| CGRect rc = mainV.frame; |