Skip to content

Instantly share code, notes, and snippets.

View Code generation pattern proposal.md

Tool specific Intermediate Representation

The Intermediate Representation (IR) resolves to a tree of Descriptors, e.g.:

  • EnumDescriptor, which has EnumVariantDescriptors which may have FieldDescriptors
  • RecordDescriptor which have FieldDescriptors.
  • ObjectDescriptor which have MethodDescriptors, which may have ArgDescriptors.

These represent the concrete types and syntactic structures within those types.

View Tidy up with two WITH clauses.
WITH tmpHistory AS (
SELECT
historyID,
url,
title,
guid,
domain_id,
domain,
localVisitDate,
remoteVisitDate,
@jhugman
jhugman / gist:28deffc543973db4e9958a45ad390bed
Created Nov 16, 2017
Device Logs and Console.app log for a crash.
View gist:28deffc543973db4e9958a45ad390bed
Nov 16 19:51:21 Rhinestone-6 locationd[59] <Notice>: Incrementing METs -- mets:<private> metsFromGrade:<private>
Nov 16 19:51:22 Rhinestone-6 locationd[59] <Notice>: message 'kCLConnectionMessageWatchdog' received from client 'com.apple.locationd'
Nov 16 19:51:23 Rhinestone-6 CommCenter(libATCommandStudioDynamic.dylib)[74] <Notice>: QMI: Svc=0x03(NAS) Ind MsgId=0x0051 Bin=['01 2A 00 80 03 03 04 39 27 51 00 1E 00 11 08 00 83 05 00 00 96 FF FF FF 14 06 00 C2 F2 A1 FF FC FF A2 01 00 32 A4 03 00 01 64 00']
Nov 16 19:51:23 Rhinestone-6 SpringBoard(Security)[53] <Notice>: could not enable test hierarchy: ApplePinningAllowTestCertsiPhoneApplicationSigning not true
Nov 16 19:51:23 Rhinestone-6 SpringBoard(Security)[53] <Notice>: could not enable test hierarchy: ApplePinningAllowTestCertsiPhoneApplicationSigning not true
Nov 16 19:51:23 Rhinestone-6 SpringBoard[53] <Notice>: Running <SBAppToAppWorkspaceTransaction: 0x10be740b0> for transition request:
<SBMainWorkspaceTransitionRequest: 0x1748ed600; eventLabel: Activat
View gist:8b6a940a7b4456a1d3588bbb646b2874
sqlite> select guid, parentid, typeof(parentid) from bookmarksBuffer;
C0id2ZbK4Wdm||null
Tii-sTGh_eXW||null
jMfI_8MtENR5||null
tKnLyXNzLPi1||null
xnuRzexoeA-4||null
0HMa8L9ILbUb||null
b3-qajGy-vZf||null
cgOYivyafyOH||null
-GxQdy8PmckW||null
View parent from bookmarksBufferStructure
sqlite> select parentid from bookmarksBufferStructure;
Error: no such column: parentid
sqlite> .schema bookmarksBufferStructure
CREATE TABLE bookmarksBufferStructure ( parent TEXT NOT NULL REFERENCES bookmarksBuffer(guid) ON DELETE CASCADE, child TEXT NOT NULL, idx INTEGER NOT NULL);
CREATE INDEX idx_bookmarksBufferStructure_parent_idx ON bookmarksBufferStructure (parent, idx);
sqlite> select parent from bookmarksBufferStructure;
-dvtF01g_FOE
-dvtF01g_FOE
2-TNeFaOcaCx
2-TNeFaOcaCx
@jhugman
jhugman / within_27km_with_whitelisted_categories.json
Created Nov 16, 2016
Crawled venues with the whitelisted categories, and rating criteria applied. 27km (approx 30 mins driving) from Waikaloa. Attached to: https://github.com/mozilla-mobile/prox/issues/177
View within_27km_with_whitelisted_categories.json
[
{
"name": "Lava Lava Beach Club - Waikoloa",
"rating": 4,
"review_count": 865,
"categories": [
"venues",
"hawaiian",
"newamerican"
],
@jhugman
jhugman / SchwartzianTransform.swift
Created Apr 25, 2016
Schwartzian Transform in Swift.
View SchwartzianTransform.swift
let strings = ["Peter Venkman", "Raymond Stantz", "Egon Spengler", "Dana Barrett", "Louis Tully"]
let sortedBySurname =
strings.map { ["string": $0, "surname": $0.componentsSeparatedByString(" ").last! ] }
.sort { $0["surname"]!.caseInsensitiveCompare($1["surname"]!) == .OrderedAscending }
.map { $0["string"]! }
// https://en.wikipedia.org/wiki/Schwartzian_transform
View gist:ca1c5e646afdb90dc5ab
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCxBqz6QqmcWyLUgiasgTPV4EAIvq/UwGnEbrxfybRgay11VYSR1h+9oMMJNcMWB3m39mms4gDBI9D71kH++JUyIIBFVDsuAuZ16/2c/HWR2s4hYmBOtHRGduLGHjP0Advfqxc8jRr0lUz4Ip2msd7bok5ZXT5dIJ6U8NK+e3WD02G1SIKOcnEhGIkZ13I0BJ1QDpIljOgaOHvISn6t6L7CIqS1CZafoYj6Z+FShO+J96hxX2D2pPiUPWrIighlrf4ZxNC3M93BpImwtMcEFSJsGelmZ85cdOYZPTgtTabRzFT7LTvPbVmzGI8CFA3TvVtz0aE2bISUKiSXeNq2UqHR jhugman@mozilla.com