Skip to content

Instantly share code, notes, and snippets.

View philipxjm's full-sized avatar
🏠
Working from home

Philip Xu philipxjm

🏠
Working from home
View GitHub Profile
-(void) logInWithTwitter
{
// check Twitter is configured in Settings or not
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]){
self.accountStore = [[ACAccountStore alloc] init]; //retain ACAccountStore
ACAccountType *twitterAcc = [self.accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
[self.accountStore requestAccessToAccountsWithType:twitterAcc options:nil completion:^(BOOL granted, NSError *error){
//permission is granted
if (granted){
self.account = [[self.accountStore accountsWithAccountType:twitterAcc] lastObject];
import java.awt.*;
import java.awt.event.*;
import javax.media.opengl.*;
import javax.media.opengl.awt.GLCanvas;
import javax.media.opengl.fixedfunc.*;
import com.jogamp.opengl.util.Animator;
/**
* Self-contained example (within a single class only to keep it simple)
* displaying a rotating quad