- Some utilities:
sudo apt-get install vim tmux git
- Copy/paste from the command line:
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 |
#!/bin/bash | |
# Copyright 2017 Théo Chamley | |
# Permission is hereby granted, free of charge, to any person obtaining a copy of | |
# this software and associated documentation files (the "Software"), to deal in the Software | |
# without restriction, including without limitation the rights to use, copy, modify, merge, | |
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons | |
# to whom the Software is furnished to do so, subject to the following conditions: | |
# | |
# The above copyright notice and this permission notice shall be included in all copies or |
set guifont=Monaco:h10 " 字体 && 字号 | |
set tabstop=4 " 设置tab键的宽度 | |
set shiftwidth=4 " 换行时行间交错使用4个空格 | |
set autoindent " 自动对齐 | |
set backspace=2 " 设置退格键可用 | |
set cindent shiftwidth=4 " 自动缩进4空格 | |
set smartindent " 智能自动缩进 | |
set ai! " 设置自动缩进 | |
set nu! " 显示行号 | |
set ruler " 右下角显示光标位置的状态行 |
#define ApplicationDelegate ((AppDelegate *)[[UIApplication sharedApplication] delegate]) | |
#define UserDefaults [NSUserDefaults standardUserDefaults] | |
#define NotificationCenter [NSNotificationCenter defaultCenter] | |
#define SharedApplication [UIApplication sharedApplication] | |
#define Bundle [NSBundle mainBundle] | |
#define MainScreen [UIScreen mainScreen] | |
#define ShowNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = YES | |
#define HideNetworkActivityIndicator() [UIApplication sharedApplication].networkActivityIndicatorVisible = NO | |
#define NetworkActivityIndicatorVisible(x) [UIApplication sharedApplication].networkActivityIndicatorVisible = x | |
#define NavBar self.navigationController.navigationBar |
- (void)insertString:(NSString *)inputKey | |
{ | |
// Insert text (doing delegate calls appropiately) | |
NSRange changeRange = target.selectedRange; | |
if (!target.delegate || ([target.delegate respondsToSelector:@selector(textView:shouldChangeTextInRange:replacementText:)] && | |
[target.delegate textView:target shouldChangeTextInRange:changeRange replacementText:inputKey])) { | |
// MarkedText could happen in multi-stage input languages | |
// In iOS5 several methods of UITextInput and UIKeyInput are badly implemented in UITextView | |
// setMarkedText:selectedRange: method seems to delete current markedText. | |
// Unmarking the text before inserting it is better than nothing. |
// Reference: | |
// https://github.com/iamcal/php-emoji | |
// http://de.wikipedia.org/wiki/Unicode-Block_Kombinierende_diakritische_Zeichen_f%C3%BCr_Symbole | |
- (BOOL)hasEmoji | |
{ | |
__block BOOL emoji = NO; | |
[self enumerateSubstringsInRange:NSMakeRange(0, self.length) | |
options:NSStringEnumerationByComposedCharacterSequences | |
usingBlock:^(NSString *substring, NSRange substringRange, NSRange enclosingRange, BOOL *stop) { |
// UIImage+Alpha.h | |
// Created by Trevor Harmon on 9/20/09. | |
// Free for personal or commercial use, with or without modification. | |
// No warranty is expressed or implied. | |
// Helper methods for adding an alpha layer to an image | |
@interface UIImage (Alpha) | |
- (BOOL)hasAlpha; | |
- (UIImage *)imageWithAlpha; | |
- (UIImage *)transparentBorderImage:(NSUInteger)borderSize; |
Note that this validation runs both after the file is uploaded and after CarrierWave has processed the image. If your base uploader includes a filter to resize the image then the validation will be run against the resized image, not the original one that was uploaded. If this causes a problem for you, then you should avoid using a resizing filter on the base uploader and put any specific size requirements in a version instead.
So instead of this:
require 'carrierwave/processing/mini_magick'
// | |
// AutoLocalize.h | |
// AutoLocalize | |
// | |
// Created by Stefan Matthias Aust on 05.08.11. | |
// Copyright 2011 I.C.N.H. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |