This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define potPin 0 | |
#define ledPin 9 | |
int potVal; | |
void setup() | |
{ | |
/**********************************************************************************/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//date set | |
NSCalendar *calendar = [NSCalendar currentCalendar]; | |
NSDateComponents *componentsToday = [calendar components:NSMinuteCalendarUnit | NSHourCalendarUnit | NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit fromDate:[NSDate date]]; | |
NSDateComponents *componentsNews = [calendar components:NSMinuteCalendarUnit | NSHourCalendarUnit | NSDayCalendarUnit | NSMonthCalendarUnit | NSYearCalendarUnit fromDate:comment.commentDate]; | |
NSString *stringFromDate; | |
NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; | |
if([componentsToday year] == [componentsNews year]) { | |
if ([componentsToday day] == [componentsNews day] && [componentsToday month] == [componentsNews month]) { | |
[formatter setDateFormat:@"HH:mm, , Сегодня"]; | |
stringFromDate = [formatter stringFromDate:[calendar dateFromComponents:componentsNews]]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function jsonToReadable( $jsonString) | |
{ | |
$tabcount = 0; | |
$result = ''; | |
$inquote = false; | |
$tab = " "; | |
$newline = "\n"; | |
for($i = 0; $i < strlen( $jsonString); $i++) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get actual user picture from VKONTAKTE by UID | |
- (void)getUserPictureVK:(NSString*)uid | |
{ | |
NSString *requestURLstring = [NSString stringWithFormat:@"https://api.vkontakte.ru/method/getProfiles?uid=%@&fields=photo", uid]; | |
NSURL *requestURL = [NSURL URLWithString:requestURLstring]; | |
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:requestURL]; | |
[request setTimeoutInterval:10]; | |
AFJSONRequestOperation *operation = [AFJSONRequestOperation operationWithRequest:request | |
success:^(id JSON) { |