I hereby claim:
- I am youssman on github.
- I am wassimboy (https://keybase.io/wassimboy) on keybase.
- I have a public key whose fingerprint is 137A D131 6310 FAAF 0E52 6293 F52D 1147 6974 5004
To claim this, I am signing this object:
| #!/usr/bin/env bash | |
| # Using bento/ubuntu-14.04 vm box and Vagrant v1.9.8 | |
| # Corresponding line in Vagrantfile: config.vm.provision "shell", path: "bash-it.sh", privileged: false | |
| # https://github.com/Bash-it/bash-it | |
| # https://www.vagrantup.com | |
| export DEBIAN_FRONTEND=noninteractive | |
| # Clonning bash-it repo |
| -(CGSize)frameForText:(NSString*)text sizeWithFont:(UIFont*)font constrainedToSize:(CGSize)size lineBreakMode:(NSLineBreakMode)lineBreakMode { | |
| NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy]; | |
| paragraphStyle.lineBreakMode = lineBreakMode; | |
| NSDictionary * attributes = @{NSFontAttributeName:font, | |
| NSParagraphStyleAttributeName:paragraphStyle | |
| }; | |
| NSDictionary *underlineAttribute = @{NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle)}; | |
| myLabel.attributedText = [[NSAttributedString alloc] initWithString:@"Underline UILabel text" attributes:underlineAttribute]; |
| NSString *string = @" this text has spaces before and after "; | |
| NSString *trimmedString = [string stringByTrimmingCharactersInSet: | |
| [NSCharacterSet whitespaceCharacterSet]]; |
| NSArray *array1 = [NSArray arrayWithObjects:@"1", @"2", @"3", nil]; | |
| NSString *joinedString = [array1 componentsJoinedByString:@","]; |
| function dashToCamelCase( myStr ) { | |
| return myStr.replace(/-([a-z])/g, function (g) { return g[1].toUpperCase(); }); | |
| } | |
| var myStr = dashToCamelCase( 'this-string' ); | |
| alert( myStr ); // => thisString |
| function camelCaseToDash( myStr ) { | |
| return myStr.replace( /([a-z])([A-Z])/g, '$1-$2' ).toLowerCase(); | |
| } | |
| var myStr = camelCaseToDash( 'thisString' ); | |
| alert( myStr ); // => this-string |
I hereby claim:
To claim this, I am signing this object:
| <!-- ... --> | |
| <!-- You have to use ${structure expresssion} syntax to escape HTML tags. | |
| The use of "tal:define" (to handle the case when no string is defined in the array) is important | |
| because we can't combine the two PHPTALES "structure" and "string" in the same expression. --> | |
| <div tal:define="myVarWithTags string:a br tag<br/>for example"> | |
| ${structure myArray/ofString | myVarWithTags} | |
| </div> | |
| <!-- ... --> |
| NSArray* split = [@"10/04/2011" componentsSeparatedByString: @"/"]; | |
| NSString* mounth = [split objectAtIndex: 1]; |