Skip to content

Instantly share code, notes, and snippets.

@guanbo
guanbo / agent loop
Created March 12, 2025 02:21 — forked from jlia0/agent loop
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
var end = parseInt(new Date().getTime() / 86400000, 10)
var start = end - 1;
var query = {
"value.statAt": {
"$lte": 10000000000000000,
"$gt": 0
}
}
var billDailys = db["deals-daily"].find(query);
//printjson(billDailys.count());
@interface UILabel (dynamicSizeMe)
-(float)resizeToFit;
-(float)expectedHeight;
@end
#import <UIKit/UIKit.h>
@interface UILabel (ContentSize)
- (CGSize)contentSize;
@end
@guanbo
guanbo / gist:4248359
Created December 10, 2012 04:19
timeIntervalSinceNowString
- (NSString *)timeIntervalSinceNowString:(NSDate *)date {
NSTimeInterval interval = [date timeIntervalSinceNow];
NSString *stringInterval = nil;
if (interval < 3600) {
stringInterval = [NSString stringWithFormat:@"%.0f%@", interval/60, NSLocalizedString(@"Minutes", nil)];
} else if (interval < 3600*24) {
stringInterval = [NSString stringWithFormat:@"%.0f%@", interval/3600, NSLocalizedString(@"Hours", nil)];
} else if (interval < 3600*24*31) {
stringInterval = [NSString stringWithFormat:@"%.0f%@", interval/3600/24, NSLocalizedString(@"Days", nil)];
} else if (interval < 3600*24*365) {
@guanbo
guanbo / gist:3747843
Created September 19, 2012 05:25
login function
exports.login = function(req, res, next) {
if (!req.body || !req.body.cellphone || !req.body.password || !req.body.org) {
return feedback({status:400, error:'信息不完整。'});
}
var loginname = sanitize(req.body.cellphone).trim().toLowerCase();
var pass = sanitize(req.body.password).trim();
var org = req.body.org;
var role = sanitize(req.body.role).ifNull("");
var ep = EventProxy.create();