Перейти до основного вмісту

Публікації

IOS UILabel vertical alignment

taken from stackowerflow.com CGSize maximumSize = CGSizeMake ( 300 , 9999 ); NSString * dateString = @ "The date today is January 1st, 1999" ; UIFont * dateFont = [ UIFont fontWithName :@ "Helvetica" size : 14 ]; CGSize dateStringSize = [ dateString sizeWithFont : dateFont constrainedToSize : maximumSize lineBreakMode : self . dateLabel . lineBreakMode ]; CGRect dateFrame = CGRectMake ( 10 , 10 , 300 , dateStringSize . height ); self . dateLabel . frame = dateFrame ;

want to automatically format your code - asytyle

astyle can automatically update your code with desired style. Documentation. my astyle is this options="--style=k/r --pad-header --pad-paren-in --add-brackets --align-pointer=type --indent=spaces" find . -iname "*.cpp" -or -iname "*.h" | xargs astyle $options.

Sending mails from linux shell

You need to have ssmtp and mutt installed. /etc/ssmtp/ssmtp.conf root=sasha@e-mail.ua mailhub=smtp.gmail.com:587 rewriteDomain= hostname=sasha@e-mail.ua UseSTARTTLS=YES AuthUser=sashao@e-mail.ua AuthPass=somepass FromLineOverride=YES /etc/ssmtp/revaliases root:sasha@e-mail.ua:smtp.gmail.com:587 oomel:sasha@e-mail.ua:smtp.gmail.com:587 #localusername:username@gmail.com:smtp.gmail.com:587 ~/.muttrc set sendmail = /usr/sbin/ssmtp unset record Done! Now send mails like this: echo "m body of email" | mutt -s "subject of email" sashao@bigmir.net -a /home/oomel/softserve.gif