brew install mongodb
Set up launchctl to auto start mongod
$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents
/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)
| // This hack works with com.android.tools.build:gradle:0.2, won't work in later version without modification | |
| apply plugin: 'android' | |
| targetCompatibility = 1.6 | |
| sourceCompatibility = 1.6 | |
| android { | |
| target = 'android-14' |
| -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath | |
| { | |
| // Remove seperator inset | |
| if ([cell respondsToSelector:@selector(setSeparatorInset:)]) { | |
| [cell setSeparatorInset:UIEdgeInsetsZero]; | |
| } | |
| // Prevent the cell from inheriting the Table View's margin settings | |
| if ([cell respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]) { | |
| [cell setPreservesSuperviewLayoutMargins:NO]; |
| static UITableViewCell *sizingCell = nil; | |
| static dispatch_once_t onceToken; | |
| dispatch_once(&onceToken, ^{ | |
| sizingCell = [self tableView:tableView cellForRowAtIndexPath:indexPath]; | |
| }); | |
| [sizingCell setNeedsLayout]; | |
| [sizingCell layoutIfNeeded]; | |
| CGFloat height = [sizingCell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height; | |
| return height; |
| - (NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| UITableViewRowAction *moreAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"More" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){ | |
| // maybe show an action sheet with more options | |
| [self.tableView setEditing:NO]; | |
| }]; | |
| moreAction.backgroundColor = [UIColor lightGrayColor]; | |
| UITableViewRowAction *blurAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Blur" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath){ | |
| [self.tableView setEditing:NO]; | |
| }]; |
| Map<String, List<Pojo>> map = pojos.stream().collect(Collectors.groupingBy(Pojo::getKey)); |
| override func tableView(tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: NSIndexPath) { | |
| if (indexPath.row == formList!.count - 1) { | |
| cell.separatorInset = UIEdgeInsetsMake(0, cell.bounds.size.width, 0, 0) | |
| return; | |
| } | |
| cell.separatorInset = UIEdgeInsetsZero | |
| if #available(iOS 8.0, *) { | |
| cell.preservesSuperviewLayoutMargins = false |
| #!/bin/bash | |
| while read oldrev newrev refname | |
| do | |
| branch=$(git rev-parse --symbolic --abbrev-ref $refname) | |
| if [ "developer" == $branch ]; then | |
| echo 'start call jenkins' | |
| curl -s --user 用户名:密码 url | |
| echo 'end call jenkins' | |
| fi | |
| done |
| var ( | |
| codes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/~!@#$%^&*()_=" | |
| codeLen = len(codes) | |
| ) | |
| func RandNewStr(len int) string { | |
| data := make([]byte, len) | |
| rand.Seed(time.Now().UnixNano()) | |
| for i := 0; i < len; i++ { |