I hereby claim:
- I am purplecabbage on github.
- I am purplecabbage (https://keybase.io/purplecabbage) on keybase.
- I have a public key whose fingerprint is 3AE6 4F0A BB1D 565B 81E8 2AFC 934B A36F D6CF D12D
To claim this, I am signing this object:
async function main (params) { | |
console.log('params?.__ow_headers?.cookie =', params?.__ow_headers?.cookie) | |
let newValue = params?.__ow_headers?.cookie?.split('=')[1] || 0 | |
return { | |
statusCode:200, | |
headers: { 'Content-Type': 'text/html', | |
'set-cookie': `mycookie=${parseInt(newValue) + 1}; Secure; HttpOnly; SameSite=Strict` | |
}, | |
body: |
const { Core, Files, State } = require('@adobe/aio-sdk') | |
async function main(params) { | |
let runCounter = { value: 0 } | |
// call state lib | |
const stateLib = await State.init() | |
try { | |
runCounter = await stateLib.get('runCounter') || { value: 0 } | |
console.log('runCounter = ', runCounter) |
function setPackageBin (packageBinName, packageJson) { | |
if (packageBinName && packageBinName.trim().length > 0) { | |
const [key, value] = Object.entries(packageJson.bin)[0] | |
packageJson.bin = { [packageBinName] : value } | |
} | |
return packageJson | |
} | |
I hereby claim:
To claim this, I am signing this object:
var cordovaExec = cordova.exec; | |
var log = console.log; | |
cordova.exec = function(ftw, wtf, service, action, args) { | |
var cbId = service + cordova.callbackId++; | |
cordova.callbacks[cbId] = {success: ftw, fail: wtf}; | |
log("Blocked call to : " + service + "/" + action); | |
log("Args to call were : " + JSON.stringify(args)); | |
log('callbackId is ' + cbId); | |
} | |
log("cordova.exec has been plugged, in order to push a result, call : "); |
document.addEventListener('deviceready',function() { | |
var deltaT = +new Date() - window.performance.timing.navigationStart; | |
var perfLog = window.localStorage.perfLog ? JSON.parse(window.localStorage.perfLog) : []; | |
perfLog.push(deltaT); | |
window.localStorage.perfLog = JSON.stringify(perfLog); | |
var maxSamples = 100; | |
if (perfLog.length < maxSamples) { | |
window.location.reload(); |
REM Solution is posted here, saving this if this ever happens to me again. | |
REM http://windowsitpro.com/windows/jsi-tip-9651-how-can-i-delete-folder-returns-path-too-long | |
@echo off | |
if \{%1\}==\{\} @echo Syntax: DelFolder FolderPath&goto :EOF | |
if not exist %1 @echo Syntax: DelFolder FolderPath - %1 NOT found.&goto :EOF | |
setlocal | |
set folder=%1 | |
set MT="%TEMP%\DelFolder_%RANDOM%" | |
MD %MT% |
Based on observations made with PhoneGap/Cordova 3.4, Visual Studio 2013 Update 2 (RTM), and Windows Phone 8.1.
window.addEventListener("error", function (err) { | |
console.log("Error in file: " + err.filename + | |
" ln:" + err.lineno + | |
" : " + err.message); | |
}); |
(function () { | |
var locStr = window.location.toString(); | |
// we will want to clean up the full path for iOS ... | |
var splitStr = locStr.substring("file://", locStr.lastIndexOf("/") - 1); | |
console.trace = function () { | |
try { | |
throw new Error(); | |
} catch (e) { | |
// skip the first 2 items, they will be the error we just threw and info on this very function | |
if (e.stack) { |