- 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 |
| #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> |
| set :rails_env, :production | |
| set :unicorn_binary, "/usr/bin/unicorn" | |
| set :unicorn_config, "#{current_path}/config/unicorn.rb" | |
| set :unicorn_pid, "#{current_path}/tmp/pids/unicorn.pid" | |
| namespace :deploy do | |
| task :start, :roles => :app, :except => { :no_release => true } do | |
| run "cd #{current_path} && #{try_sudo} #{unicorn_binary} -c #{unicorn_config} -E #{rails_env} -D" | |
| end | |
| task :stop, :roles => :app, :except => { :no_release => true } do |