Skip to content

Instantly share code, notes, and snippets.

Akash appsparkler

Block or report user

Report or block appsparkler

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@appsparkler
appsparkler / cordova writing file.js
Created Mar 9, 2019
Cordova Writing On An Existing File If Already Available (updating data)
View cordova writing file.js
var fileName = 'test-450.json';
var fileData;
var savedFileEntry = {};
promise_getPersistentDirectoryEntry()
.then(promise_fileEntry.bind(null, fileName, { create:false }))
.then(save_fileEntry)
.then(promise_file)
.then(promise_fileContent)
View AEM-get-image-paths-for-package-filter.js
var filters = ""
$('img').toArray().forEach(iterateImageElements.bind(this));
console.log(filters)
function iterateImageElements(){
var _this = arguments[0];
filters += getImagePaths.apply(_this, arguments) + "\n";
}
View AEM_QueryBuilderAPI.js
/*
gist: https://gist.github.com/appsparkler/7ce9d5e7e607a95c483d88fabb9a611e
% - The percent sign represents zero, one, or multiple characters
_ - The underscore represents a single character
*/
{
let domain = "https://env01-author.kpmg.com";
let url = `${domain}/bin/querybuilder.json`;
View colorLog.js
function colorLog(msg1, msg2) {
var css = "text-shadow: -1px -1px hsl(0,100%,50%), 1px 1px hsl(5.4, 100%, 50%), 3px 2px hsl(10.8, 100%, 50%), 5px 3px hsl(16.2, 100%, 50%), 7px 4px hsl(21.6, 100%, 50%), 9px 5px hsl(27, 100%, 50%), 11px 6px hsl(32.4, 100%, 50%), 13px 7px hsl(37.8, 100%, 50%), 14px 8px hsl(43.2, 100%, 50%), 16px 9px hsl(48.6, 100%, 50%), 18px 10px hsl(54, 100%, 50%), 20px 11px hsl(59.4, 100%, 50%), 22px 12px hsl(64.8, 100%, 50%), 23px 13px hsl(70.2, 100%, 50%), 25px 14px hsl(75.6, 100%, 50%), 27px 15px hsl(81, 100%, 50%), 28px 16px hsl(86.4, 100%, 50%), 30px 17px hsl(91.8, 100%, 50%), 32px 18px hsl(97.2, 100%, 50%), 33px 19px hsl(102.6, 100%, 50%), 35px 20px hsl(108, 100%, 50%), 36px 21px hsl(113.4, 100%, 50%), 38px 22px hsl(118.8, 100%, 50%), 39px 23px hsl(124.2, 100%, 50%), 41px 24px hsl(129.6, 100%, 50%), 42px 25px hsl(135, 100%, 50%), 43px 26px hsl(140.4, 100%, 50%), 45px 27px hsl(145.8, 100%, 50%), 46px 28px hsl(151.2, 100%, 50%), 47px 29px hsl(156.6, 100%, 50%), 48px 30px hsl(162, 100%,
View ObjectToPropertyMap.js
function isObject(x) {
return Object.prototype.toString.call(x) === '[object Object]';
};
function getObjPath(obj, pathArray, busArray) {
pathArray = pathArray ? pathArray : [];
if (isObject(obj)) {
for (key in obj) {
if (obj.hasOwnProperty(key)) {
if (isObject(obj[key])) {
@appsparkler
appsparkler / settings.xml
Created Aug 31, 2018
Adobe, KPMG, WCM.IO settings.xml for Maven
View settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under
the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in
writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the
License. -->
<!-- | This is the configuration file for Maven. It can be specified at two levels: | | 1. User Level. This settings.xml file provides configuration for a single user, | and is normally provided in ${user.home}/.m2/settings.xml
@appsparkler
appsparkler / getQueryParams.js
Created Mar 8, 2017 — forked from ryoppy/getQueryParams.js
Parse query string. use Underscore.js.
View getQueryParams.js
/**
* Parse query string.
* ?a=b&c=d to {a: b, c: d}
* @param {String} (option) queryString
* @return {Object} query params
*/
getQueryParams: function(queryString) {
var query = (queryString || window.location.search).substring(1); // delete ?
if (!query) {
return false;
View Nightwatch starter.md

Install the needed packages

npm i --save-dev nightwatch selenium-server chromedriver

Create a e2e-tests dir:

mkdir e2e-tests
View fetch-item-and-comments-and-store-em.js
export default (store) => {
const
{ state, dispatch }
= store,
itemId
= state.route.params.itemId,
fetchItems
= ids => dispatch('FETCH_ITEMS', { ids }),
getFetchedItem
= () => Promise.resolve(state.items[itemId]),
You can’t perform that action at this time.