Skip to content

Instantly share code, notes, and snippets.

View chrisekelley's full-sized avatar

Chris E. Kelley chrisekelley

View GitHub Profile
@chrisekelley
chrisekelley / sqlite-plugin-largeHeap-property
Last active April 6, 2021 15:30
Testing after adding android:largeHeap="true" to Cordova project
It passed the 15MB and 25MB payload test, but failed at 35MB:
Error:
```console
04-06 10:01:00.083 2838 3034 I g.rti.tangerin: Starting a blocking GC Alloc
04-06 10:01:00.083 2838 3034 I g.rti.tangerin: Starting a blocking GC Alloc
04-06 10:01:00.133 2838 3034 I g.rti.tangerin: Alloc concurrent copying GC freed 92(18KB) AllocSpace objects, 0(0B) LOS objects, 18% free, 107MB/131MB, paused 103us total 49.774ms
04-06 10:01:00.133 2838 3034 I g.rti.tangerin: Starting a blocking GC Alloc
04-06 10:01:00.157 2838 3034 I g.rti.tangerin: Alloc concurrent copying GC freed 3(16KB) AllocSpace objects, 0(0B) LOS objects, 18% free, 107MB/131MB, paused 112us total 24.169ms
@chrisekelley
chrisekelley / sqlite-plugin-memory-test.js
Created March 18, 2021 02:58
Testing Pouch/sqlite memory
// Open the app, open js debugger and ADB console
// Change the size, in MB
// After running this test, close the app to clear memory.
// If the test is successull it will return the payload size in MB
// and on the next line it will display the doc:
// 15 MB
// newDoc: {"ok":true,"id":"26670b3f-7b36-43d4-a5cb-1783b0108c77","rev":"1-c0f943597a9c1f9160d0880081e91803"}
// When it fails, it only returns the payload size.
// Get the error from ADB console.
@chrisekelley
chrisekelley / gist:d6b3a45e2edffa3856c5a07387836ed4
Created February 4, 2021 20:35
setLocation and generateCase
async setLocation() {
// Get a Device to set the location
const device = await this.deviceService.getDevice()
if (device) {
let syncLocation = device.syncLocations[0]
let locationSetting = syncLocation.value.slice(-1).pop()
let location = {
[`${locationSetting.level}`]: locationSetting.value
}
return location

To get a nice list of tags, with dates:

git log --tags --simplify-by-decoration --pretty="format:%ai %d"

Some notes on resolving Back button issue in backbone.js

This is mildly useful because it displays the transitions from current route to the next route. It is disappointing that not only hitting the back button triggers popState.

  window.addEventListener('popstate', (e) ->
    sendTo = Backbone.history.getFragment()
  #      console.log("sendTo: " + sendTo)
    console.debug('popstate', Backbone.history.fragment, '>', Backbone.history.getFragment());

sendTo = "assessments"

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>gist-1119800</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
<html>
<head>
<script id="form-template" type="text/x-handlebars-template">
{{#formElements}}
<tr>
<td>
<label for='{{id}}'>{{label}}</label>
</td>
<td>
<input {{#options}}data-{{name}}='{{value}}' {{/options}} id='{{id}}' type='{{type}}'></input>