Skip to content

Instantly share code, notes, and snippets.

View xandrucea's full-sized avatar

Alex Cio xandrucea

View GitHub Profile
ich bin *jahre alt
condition
---------
* == {{placeholder}}
--> Oha, {{placeholer}} jahre ?!
{% if has("jahre") %}
Du bist get("jahre")
{% else %}
!!!!!!
On every user input the methods "textViewDidChange", "resizeTextViewHeight" and "textView:shouldChangeTextInRange" will be called
!!!!!!
hide keyboard when pressing return button
-----------------------------------------
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
if([text isEqualToString:@"\n"]) {
Send email
----------
- (IBAction)btFeedback:(id)sender {
if ([MFMailComposeViewController canSendMail]) {
NSString *infoString =
[NSString stringWithFormat:@"\n\nUserid: %@ \nUsername: %@ \nIsPush enabled: %@",
_userId,
change filenames inside all subdirs
-----------------------------------
$ for i in * ; do echo $i; mv $i/Localizable.strings $i/RatingLoc.strings; done
for file in *; do mv $file "es_3_$file.dat"; done
convert sound (audio) files from .wav to .mp3
---------------------------------------------
find ./ -name "*.wav" -execdir lame -V 3 -q 0 {} \;
updating pod to new tag
-----------------------
git status
git tag -n
git pull
git pull origin development
git tag -n
git tag [newNumber] -am "comment"
git tag -n
git push
Check tap on UIWebView
----------------------
1. add UIGestureRecognizer to declaration (h.file)
2. create TapGestureRecognizer and add to webview
UITapGestureRecognizer *webViewTapped = [[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(showIntersticial)];
webViewTapped.numberOfTapsRequired = 1;
webViewTapped.delegate = self;
@xandrucea
xandrucea / Alert View Snippet
Created July 15, 2013 12:51
Alertview with Activity inidicator
UIActivityIndicatorView *activityView;
UIAlertView *waitAlertView;
// delegate method of alert view
- (void)willPresentAlertView:(UIAlertView *) currAlertView {
if ( waitAlertView == currAlertView) {
activityView.center = CGPointMake( waitAlertView.bounds.size.width / 2, waitAlertView.bounds.size.height / 2 );
}
}
// replace chars
validDeviceToken = [validDeviceToken stringByReplacingOccurrencesOfString:@"<" withString:@""];
Cut whitespaces from string
---------------------------
[myString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
Extensions for Categories
__________________________
delete separators after last row
--------------------------------
self.tableView.tableFooterView = [[UIView alloc] init];
delete last separator line of tableview
---------------------------------------
if( indexPath.row == _arrayMenu.count - 1 ){
-f file, --input-file=file
Specify a file to be spoken. If file is - or neither this parameter nor a message is specified, read from standard
input.
--progress
Display a progress meter during synthesis.
-v voice, --voice=voice
Specify the voice to be used. Default is the voice selected in System Preferences. To obtain a list of voices
installed in the system, specify '?' as the voice name.