Skip to content

Instantly share code, notes, and snippets.

@apla
apla / .dataflows|example.json
Created May 27, 2014 08:47
dataflows example
[{
"path": "post",
"tasks": [{}]
}, {
"path": "upload"
}, {
"path": "presenters",
"flows": [{
"path": "json",
"data": {
{
"name": "test",
"description": "test for component v1.0.0",
"private": true,
"version": "0.94.0",
"dependencies": {
"apla/dataflo.ws": "*",
"ftlabs/fastclick": "*",
"apla/EventEmitter": "*",
"apla/node-util": "*",
@apla
apla / js#PacketSender.js
Last active August 29, 2015 13:56
sending packets of data
var PacketSender = function (url, options) {
this.data = [];
this.url = url;
options = options || {};
if (!options.maxPacketsToSend)
options.maxPacketsToSend = 100;
if (!options.timeout)
options.timeout = 60000;
this.o = options;
this.queuedPackets = {};

Application preferences Cordova plugin.

Store and fetch application preferences using platform facilities. Compatible with phonegap 3.x

Installing:

From plugin registry:

@apla
apla / DOWNLOAD GOOGLE FONT.md
Last active December 29, 2015 20:49
script to retrieve whole pack of formats for one google font

may 14, 2014

• added help • fixed some issues for fonts with space in family name

@apla
apla / gist:7627787
Last active December 29, 2015 06:19
mysql create dba user
CREATE USER 'backupdb'@'localhost' IDENTIFIED BY '++++++++++++++++++++++++++++++++++';
GRANT RELOAD ON *.* TO 'backupdb'@'localhost';
GRANT CREATE, INSERT, DROP ON mysql.ibbackup_binlog_marker TO 'backupdb'@'localhost';
GRANT CREATE, INSERT, DROP ON mysql.backup_progress TO 'backupdb'@'localhost';
GRANT CREATE, INSERT, SELECT, DROP ON mysql.backup_history TO 'backupdb'@'localhost';
GRANT REPLICATION CLIENT ON *.* TO 'backupdb'@'localhost';
GRANT SELECT,LOCK TABLES ON *.* TO 'backupdb'@'localhost';
GRANT SELECT,LOCK TABLES ON information_schema.* TO 'backupdb'@'localhost';
GRANT SUPER ON *.* TO 'backupdb'@'localhost';
GRANT CREATE TEMPORARY TABLES ON mysql.* TO 'backupdb'@'localhost';
@apla
apla / makeEl.js
Created October 28, 2013 18:01
make element js function
function MakeEl (name, attributes) {
var el = document.createElement (name);
if (typeof attributes == 'object') {
for (var i in attributes) {
el.setAttribute (i, attributes[i]);
if (i.toLowerCase() == 'class') {
el.className = attributes[i]; // for IE compatibility
} else if (i.toLowerCase() == 'style') {
using Microsoft.Phone.Controls;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.IsolatedStorage;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Windows;
@apla
apla / failed.js
Created August 19, 2013 08:59
blackberry.invoke.card
plugins.shareSocial.share = function (message, image, url, title, successCallback, failCallback) {
function success(args) {
successCallback && successCallback(args);
}
function fail(args) { console.log (args);
failCallback && failCallback(args);
}
@apla
apla / gist:6258386
Last active December 21, 2015 05:39
persistent storage check
document.addEventListener("deviceready", function () {
function fail(error) {
console.log(error.code);
}
function gotFileWriter(writer) {
writer.onwriteend = function(evt) {
var startScript = function (src) {
var script = document.createElement ('SCRIPT');
script.setAttribute ("type", "text/javascript");