coming soon
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 | |
/* | |
PHP/Drupal example of making an authenticated user search request to the Passport API | |
*/ | |
function example_passport_api_request() { | |
$server = 'http://example.com/rest/'; | |
//login request - we need to authenticate before requesting protected data | |
$username = 'username'; |
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 ($) { | |
//request user 1 in JSON format | |
$.getJSON('http://mysite.com/rest/user/1.json', function(data) { | |
console.log(data); //print the JSON response object to the console | |
}); | |
})(jQuery); |
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
var fetchCache = {}; | |
function fetchJSON(url, callback, secondsToCache) { | |
secondsToCache = secondsToCache ? secondsToCache : 60*60; //default to one hour | |
var nowInSeconds = Math.round(new Date().getTime() / 1000); | |
if (!fetchCache[url] || ((fetchCache[url].timestamp + secondsToCache) < nowInSeconds)) { | |
$.getJSON(url, function(response) { | |
fetchCache[url] = {response: response, timestamp: nowInSeconds}; | |
callback(fetchCache[url].response); | |
}); | |
} |
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
val preferences : SharedPreferences = ... | |
//Old way... | |
val MY_BOOLEAN_PREF = "myBooleanPref" | |
val MY_STRING_PREF = "myStringPref" | |
fun oldSharedPreferenceExample() { | |
//set | |
val editor = preferences.edit() |
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
#!/bin/sh | |
if [ -z "$1" ] | |
then | |
echo must provide a PR number | |
else | |
git fetch origin pull/$1/head:pr-$1 # for github | |
git fetch origin pull-requests/$1/from:pr-$1 # for bitbucket | |
git checkout pr-$1 | |
studio . |
Integration
- Will merging this code create source conflicts?
- Is there a clear and concise description of the changes?
- Did all automated checks (build, test, lint) run and pass?
- Are there supporting metrics or reports (e.g. test coverage, fitness functions) that measure the impact?
- Are there obvious logic errors or incorrect behaviors that might break the software?
Readability