Skip to content

Instantly share code, notes, and snippets.

View Whebcraft's full-sized avatar
🟢
I have never let my schooling interfere with my education.

Lucky Onagite Whebcraft

🟢
I have never let my schooling interfere with my education.
View GitHub Profile
var pay = {
charge: function(card, price, callback) {
window.PaystackPlugin.chargeCard(function(resp) {
var msg = {
id: resp.reference,
message: 'Successfull'
};
callback(msg);
}, function(resp) {
var msg = {
@Whebcraft
Whebcraft / sample.html
Created August 11, 2016 20:15
Cordova image upload from camera or gallery
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; connect-src *">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
<meta name="mobile-web-app-capable" content="yes">
<title>Photo Upload App</title>
<script type="text/javascript" src="cordova.js"></script>
<script>
@Whebcraft
Whebcraft / code.js
Last active July 29, 2016 23:15
Cordova display all the installed apps on the users phone
// call this function first to check if the icons has been generated..
function appsIconCheck() {
window.requestFileSystem(window.TEMPORARY, 1024 * 1024, function(fs) {
fs.root.getDirectory('/data/data/com.awaa.applauncher/icons', {
create: false
}, function(dirEntry) {
// icons generated lets get all the apps.
window.installedapps.getApps({
success: generateApps