Skip to content

Instantly share code, notes, and snippets.

@leoru
leoru / install-thrift-0.11.0-with-brew.sh
Created August 23, 2021 15:28 — forked from tonydeng/install-thrift-0.11.0-with-brew.sh
Install Thrift 0.11.0 with brew on macOS
#!/bin/bash
brew unlink thrift
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/4ba654c6d99b3b6804dd3843546a9dcbb700188b/Formula/thrift.rb
@leoru
leoru / ios-questions-interview.md
Created October 3, 2015 07:16 — forked from arturlector/ios-questions-interview.md
Вопросы на собеседование iOS разработчика.

Вопросы на собеседование iOS разработчика (дополненное издание):

General:

  • Что такое полиморфизм?

  • Что такое *инкапсуляция? Что такое *нарушение инкапсуляции?

  • Чем абстрактный класс отличается от интерфейса?

  • Расскажите о паттерне MVC. Чем отличается пассивная модель от активной?

@leoru
leoru / gist:6866278
Created October 7, 2013 11:19
Facebook Account type
// Initialize the account store
self.accountStore = [[ACAccountStore alloc] init];
// Get the Facebook account type for the access request
ACAccountType *fbAccountType = [self.accountStore
accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
// Request access to the Facebook account with the access info
[self.accountStore requestAccessToAccountsWithType:fbAccountType
options:fbInfo
@leoru
leoru / gist:6866165
Created October 7, 2013 11:11
Facebook openSession
+(void)handleSessionWithCompletion:(void (^)(void))completion {
if (FBSession.activeSession.isOpen) {
completion();
} else {
NSArray *permissions = @[@"user_birthday"];
[FBSession openActiveSessionWithReadPermissions:permissions
allowLoginUI:YES completionHandler:^(FBSession *session,
FBSessionState status,
NSError *error) {
if (error) {
public function get_checkin_poll()
{
$filepath = 'storage/work/checkin_poll_' . Auth::user()->id;
$last_cycle = File::get($filepath);
$break = false;
$thread = uniqid();
// if last cycle was > 60 secs continue