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
function FindProxyForURL(url, host) { | |
// Plain hostnames. ( e.g. http://server ) | |
if (isPlainHostName(host)) { | |
return "DIRECT"; | |
} | |
// Private address classes. | |
if (isInNet(dnsResolve(host), "10.0.0.0", "255.0.0.0") || | |
isInNet(dnsResolve(host), "172.16.0.0", "255.240.0.0") || |
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
//// First, Implement an interface to intercept the HTTP Request before it goes out. | |
package com.google.java_scratch; | |
import com.google.api.client.auth.oauth2.Credential; | |
import com.google.api.client.http.HttpBackOffIOExceptionHandler; | |
import com.google.api.client.http.HttpBackOffUnsuccessfulResponseHandler; | |
import com.google.api.client.http.HttpBackOffUnsuccessfulResponseHandler.BackOffRequired; | |
import com.google.api.client.http.HttpRequest; | |
import com.google.api.client.http.HttpRequestInitializer; | |
import com.google.api.client.http.HttpResponse; |
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
//// First, Implement an interface to intercept the HTTP Request before it goes out. | |
import java.io.IOException; | |
import com.google.api.client.googleapis.services.AbstractGoogleClientRequest; | |
import com.google.api.client.googleapis.services.GoogleClientRequestInitializer; | |
public class TracingTokenInitializer implements GoogleClientRequestInitializer { | |
@Override | |
public void initialize(AbstractGoogleClientRequest<?> req) throws IOException { | |
System.out.println("Attaching tracing token..."); | |
req.put("trace", "token:<<TOKEN GOES HERE>>"); |
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
$service = new Google_Service_Directory($googleClient); | |
// A tracing token can be utilizing with the PHP 1.0 library by passing an associative array to | |
// the '$optParams' value of the method call. The order of this parameter varies for each method call, | |
// but is typically immediately after the required arguments. | |
// | |
// The tracing token parameter will need to be added to EACH AND EVERY call where a tracing token is required. | |
$makeAdmin = new Google_Service_Directory_UserMakeAdmin(); | |
$makeAdmin->setStatus(true); | |
$service->users->makeAdmin('marty.mcfly@timecircuit.org', $makeAdmin, array( |
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
service = build(serviceName="admin", | |
version="directory_v1", | |
http=httplib2.Http()) | |
# A tracing token can be attached by utilizing the 'trace' kwarg on a method call. | |
# Switching the request to utilize all 'kwargs' is recommended. | |
# | |
# Importantly, when a request (such as the one below) includes a body parameter, | |
# the tracing token should NOT be included in the body. | |
# |
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
import sys | |
import os | |
def read_file(f, split="\n"): | |
return open(f).read().split(split) | |
list1 = read_file(sys.argv[1]) | |
list2 = read_file(sys.argv[2]) |
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
import csv | |
import httplib2 | |
from argparse import ArgumentParser | |
from oauth2client.client import SignedJwtAssertionCredentials | |
from apiclient.discovery import build | |
SCOPES = [ | |
'https://www.googleapis.com/auth/apps.order' | |
] |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>JS Client Test Bench</title> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
var SETTINGS = { | |
CLIENT_ID: '801883730557-sm0htkeqruc79vm569f20gk8ponn62sv.apps.googleusercontent.com', | |
API_KEY: 'AIzaSyDobgkbnTo75Vb7XmgNBemxvbT_YKFTAPE', |
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
import os | |
import httplib2 | |
from apiclient.discovery import build | |
from oauth2client.client import SignedJwtAssertionCredentials | |
http = httplib2.Http() | |
SCOPES = [ | |
'https://www.googleapis.com/auth/calendar' | |
] |
NewerOlder