Skip to content

Instantly share code, notes, and snippets.

View trevordevore's full-sized avatar

Trevor DeVore trevordevore

View GitHub Profile
constant kMultiLineModeNone = 0
constant kMultiLineModeLiteral = 1
constant kMultiLineModeFolded = 2
command YAMLToArray pYaml
local tInDocument = true
local tPath
local tArray
local tPathLists
local tReferences
@trevordevore
trevordevore / htmlTextToMarkdown.livecodescript
Created November 6, 2017 15:17
LiveCode htmlText to Markdown
function htmlTextToMarkdown pText, pEscape
put pEscape is not false into pEscape
replace "<b>" with "<strong>" in pText
replace "</b>" with "</strong>" in pText
## http://daringfireball.net/projects/markdown/syntax
## Doesn't support targets as far as I can tell
_RemoveATagTarget pText
@trevordevore
trevordevore / behaviorsdatagridbuttonbehavior.livecodescript
Last active November 7, 2017 16:15
Fixes issues where mobileScroller is not recreated when returning to card with DataGrid on it
local sDataArray -- Multi-dimensional array
local sIndexSequencing -- sDataArray indexes in order they should appear
local sInit -- Has control been opened once before?
local sControlIsOpen
constant kDefaultDimmedHiliteColor = "212,212,212"
constant kRowColor = "255,255,255"
constant kHeaderBkgrndStartColor = "219,219,219"
constant kHeaderBkgrndEndColor = "188,188,188"
@trevordevore
trevordevore / utmtolatlong.livecodescript
Last active June 9, 2018 15:14
LiveCode function for converting a UTM location to latitude/longitude
script "UTM To LatLong Library"
/**
Summary: Converts UTM coordindates to lat/long
Parameters:
pZoneNumber: A number between 1 and 60.
pZoneLetter: A-Z, Zones A-M are soutern, N-Z are northern/
pEasting: Number
pNorthing: Number