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 cgi | |
import urllib | |
import urllib2 | |
import json | |
#client OAuth keys | |
key = 'YOUR KEY HERE' | |
secret = 'YOUR SECRET HERE' | |
#PayPal URIs and application callbacks |
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
application: oauth2-paypal | |
version: 1 | |
runtime: python | |
api_version: 1 | |
handlers: | |
- url: /.* | |
script: index.py |
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 () { | |
function m() { | |
return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent) | |
} | |
function w() { | |
return /Safari/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) | |
} | |
function x() { | |
return navigator.userAgent.match(/iPad/i) != null || navigator.userAgent.match(/iPhone/i) != null || navigator.userAgent.match(/iPod/i) != null | |
} |
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 | |
require_once "common.php"; | |
//capture code from auth | |
$code = $_GET["code"]; | |
//construct POST object for access token fetch request | |
$postvals = sprintf("client_id=%s&client_secret=%s&grant_type=authorization_code&code=%s&redirect_uri=%s", KEY, SECRET, $code, urlencode(CALLBACK_URL)); | |
//get JSON access token object (with refresh_token parameter) |
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 | |
define('KEY', 'YOUR APPLICATION ID'); | |
define('SECRET', 'YOUR APPLICATION SECRET'); | |
define('CALLBACK_URL', 'YOUR CALLBACK PATH - TO COMPLETE.PHP'); | |
define('AUTHORIZATION_ENDPOINT', 'https://identity.x.com/xidentity/resources/authorize'); | |
define('ACCESS_TOKEN_ENDPOINT', 'https://identity.x.com/xidentity/oauthtokenservice'); | |
define('PROFILE_ENDPOINT', 'https://identity.x.com/xidentity/resources/profile/me'); | |
/*************************************************************************** |
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 | |
require_once "common.php"; | |
$auth_url = sprintf("%s?scope=%s&response_type=code&redirect_uri=%s&client_id=%s", | |
AUTHORIZATION_ENDPOINT, | |
urlencode("https://identity.x.com/xidentity/resources/profile/me"), | |
urlencode(CALLBACK_URL), | |
KEY); | |
//forward user to PayPal auth page |
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
# HTTP Status Cats | |
# Apache (htaccess) config created by @dave1010 | |
# Licensed CC BY 2.0 | |
# Images CC BY 2.0, from GirlieMac's photostream: | |
# http://www.flickr.com/photos/girliemac/sets/72157628409467125/with/6508023065/ | |
# Usage: copy save this file as .htaccess or add it to your httpd.conf | |
ErrorDocument 404 '<a href="http://www.flickr.com/photos/girliemac/6508022985/" title="404 - Not Found by GirlieMac, on Flickr"><img src="http://farm8.staticflickr.com/7172/6508022985_b22200ced0.jpg" width="500" height="400" alt="404 - Not Found"></a>' |
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 | |
require_once("reddit.php"); | |
//initialize logged-in connection | |
$reddit = new reddit("USERNAME", "PASSWORD"); | |
//submit new story | |
$title = "British coffee-powered car breaks world record"; | |
$link = "http://www.extremetech.com/extreme/97287-british-coffee-powered-car-breaks-world-record"; | |
$response = $reddit->createStory($title, $link); |
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.x.sampleplugin.handlers; | |
import org.eclipse.core.commands.AbstractHandler; | |
import org.eclipse.core.commands.ExecutionEvent; | |
import org.eclipse.core.commands.ExecutionException; | |
import org.eclipse.ui.IWorkbenchWindow; | |
import org.eclipse.ui.handlers.HandlerUtil; | |
import org.eclipse.jface.dialogs.MessageDialog; | |
/** |
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
<!-- Toolbar Dropdown Menu --> | |
<extension point="org.eclipse.ui.commands"> | |
<category id="com.x.sampleplugin.dropdown.category" name="Sample Plugin DropDown"></category> | |
<command categoryId="com.x.sampleplugin.dropdown.category" id="com.x.sampleplugin.dropdown.command" name="DropDown"> | |
<commandParameter id="com.x.sampleplugin.dropdown.msg" name="DropDown Options" optional="true"></commandParameter> | |
</command> | |
<command categoryId="com.x.sampleplugin.dropdown.category" id="com.x.sampleplugin.dropdown.commandProfile" name="Profile"> | |
<commandParameter id="com.x.sampleplugin.dropdown.msg" name="DropDown Options" optional="true"></commandParameter> | |
</command> | |
<command categoryId="com.x.sampleplugin.dropdown.category" id="com.x.sampleplugin.dropdown.commandLoadSite" name="LoadSite"> |