Skip to content

Instantly share code, notes, and snippets.

View gon250's full-sized avatar
💃
I may be slow to respond.

Gonzalo gon250

💃
I may be slow to respond.
View GitHub Profile
@chibatching
chibatching / OAuthPostHurlStack.java
Last active February 3, 2018 18:14
OAuth signed POST request with Volley + oauth-signpost
public class OAuthPostHurlStack extends HurlStack {
private final OAuthConsumer mConsumer;
private ArrayList<String> mOauthSignedPosts = new ArrayList<>();
public OAuthPostHurlStack(OAuthConsumer consumer) {
mConsumer = consumer;
}
@Override
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@michaelcox
michaelcox / xdr.js
Created May 10, 2012 18:56
Adds XDomainRequest IE CORS support to jQuery
// Based on https://github.com/jaubourg/ajaxHooks/blob/master/src/ajax/xdr.js
(function( jQuery ) {
if ( window.XDomainRequest && !jQuery.support.cors ) {
jQuery.ajaxTransport(function( s ) {
if ( s.crossDomain && s.async ) {
if ( s.timeout ) {
s.xdrTimeout = s.timeout;
delete s.timeout;
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';