This file contains 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
package com.example.anothersignintest; | |
import com.google.android.gms.auth.api.Auth; | |
import com.google.android.gms.auth.api.signin.GoogleSignInAccount; | |
import com.google.android.gms.auth.api.signin.GoogleSignInOptions; | |
import com.google.android.gms.auth.api.signin.GoogleSignInResult; | |
import com.google.android.gms.common.ConnectionResult; | |
import com.google.android.gms.common.api.GoogleApiClient; | |
import com.google.android.gms.common.api.OptionalPendingResult; | |
import com.google.android.gms.common.api.ResultCallback; |
This file contains 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
#ifdef APP_DEFINE_CONSTANTS | |
#define EXTERN | |
#define INITIALIZE_AS(x) =x | |
#else | |
#define EXTERN extern | |
#define INITIALIZE_AS(x) | |
#endif | |
EXTERN const double kAppFirstConstant INITIALIZE_AS( 0.025); | |
EXTERN const double kAppOtherConstant INITIALIZE_AS( 1.1); |
This file contains 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
package com.google.devrel.samples.gmstest.app; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.os.AsyncTask; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.view.Menu; | |
import android.view.MenuItem; | |
import android.view.View; |
This file contains 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
<?php | |
/* | |
* example usage: | |
* First call to get the url | |
* php calcreate.php | |
* After authorising, grab the code from the redirect URL | |
* php calcreate.php "long_code_value_from_oauth_callback" | |
* This will var_dump out the new calendar entry | |
*/ | |
require_once 'google-api-php-client/src/Google_Client.php'; |
This file contains 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
<?php | |
include_once "zmtp.php"; | |
// This was connecting to a libzmq master based subscriber. | |
$host = "127.0.0.1"; | |
$port = 4422; | |
// Connect and send null mechanism. | |
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); | |
$rc = socket_connect($socket, $host, $port); |
This file contains 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
package com.google.plus.sample.ShareTest; | |
import android.accounts.AccountManager; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentSender; | |
import android.content.SharedPreferences; | |
import android.os.AsyncTask; | |
import android.os.Bundle; |
This file contains 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
<html><head> | |
<title>OpenID X-Has-Session</title> | |
</head> | |
<body> | |
<div id="msg"></div> | |
<script> | |
if (window.location.href.indexOf("openid.mode=") != -1) { | |
if (window.location.href.indexOf("x-has-session") != -1) { | |
document.getElementById("msg").textContent = "You be logged in"; |
This file contains 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
class ViewController: UIViewController, GIDSignInDelegate { | |
@IBOutlet weak var signInButton: GIDSignInButton! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
GIDSignIn.sharedInstance().delegate = self | |
// Test to see if we are signed in on load. | |
GIDSignIn.sharedInstance().signInSilently() | |
} |
This file contains 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
<html><head> | |
<title>checkSessionState Example</title> | |
<script> | |
(function() { | |
var po = document.createElement('script'); | |
po.type = 'text/javascript'; po.async = true; | |
po.src = 'https://apis.google.com/js/client:plusone.js?onload=OnLoadCallback'; | |
var s = document.getElementsByTagName('script')[0]; | |
s.parentNode.insertBefore(po, s); | |
})(); |
This file contains 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
if (opr.isDone()) { | |
// If the user's cached credentials are valid, the OptionalPendingResult will be "done" | |
// and the GoogleSignInResult will be available instantly. We can try and retrieve an | |
// authentication code. | |
GoogleSignInResult result = opr.get(); | |
handleSignInResult(result); | |
} else { | |
// If the user has not previously signed in on this device or the sign-in has expired, | |
// this asynchronous branch will attempt to sign in the user silently. | |
opr.setResultCallback(new ResultCallback<GoogleSignInResult>() { |
NewerOlder