Skip to content

Instantly share code, notes, and snippets.

View moust's full-sized avatar

Quentin Aupetit moust

  • ReachFive
  • Guadeloupe, France
View GitHub Profile
@moust
moust / bootstrap.php
Last active August 29, 2015 14:16
Google Calendar API connection with private key file
require_once 'vendor/google-api-php-client/src/Google/autoload.php';
// email address from the client
$serviceAccountName = '####################@developer.gserviceaccount.com';
$scopes = array(
'https://www.googleapis.com/auth/calendar',
'https://www.googleapis.com/auth/calendar.readonly'
);
@moust
moust / escapestring.js
Last active August 29, 2015 14:01
JavaScript escapeString function
var escape = {
"&": "&",
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
"'": "&#x27;",
"`": "&#x60;"
};
var badChars = /[&<>"'`]/g;
@moust
moust / Sample.java
Last active November 12, 2019 04:34
Example of implementation of APK Expansion Files download process with a PhoneGap application
package com.phonegap.Sample;
import java.io.File;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.PendingIntent;
import android.app.ProgressDialog;
import android.content.Intent;
import android.content.pm.PackageManager.NameNotFoundException;