Skip to content

Instantly share code, notes, and snippets.

@opn
opn / handler: function fedwiki_ItemChecked
Created June 23, 2017 16:21
Checks a wiki page array to see if there is a named checkbox in a markdown section. Returns true, false, or empty.
function fedwiki_ItemChecked pageArray, checkboxTitle
put pageArray ["story"] into storyArray
put item 2 of the extents of storyArray into maxItemNum
repeat with itemNum = 1 to maxItemNum
put storyArray [itemNum] into itemArray
if itemArray ["type"] is not "markdown" then next repeat
put itemArray ["text"] into itemText
switch
case itemText contains ("- [x]" && checkboxTitle)
@opn
opn / bbc.lc
Created June 22, 2017 21:00
This Transport imports a range of audio podcasts in Fedwiki - http://transport.fedwiki.org/podcast-transport.html
<?lc
/* = DESCRIPTION =
--
The bbc.lc controller can be found at: bbc.lc
Below we declare the global variables gControllerHandlers AND gData
And put the public method names that we wish to expose into gControllerHandlers
--
*/
@opn
opn / mediawiki.lc
Created June 22, 2017 17:41
Use this transport to import Wikipedia content into Fedwiki - http://transport.fedwiki.org/wikipedia-transport.html
<?lc
/* = DESCRIPTION =
--
The mediawiki.lc controller can be found at: mediawiki.lc
Below we declare the global variables gControllerHandlers AND gData
And put the public method names that we wish to expose into gControllerHandlers
--
*/
@opn
opn / script,stack 'Global_ScriptEditor_Recent_Watch_Menu'
Created August 17, 2016 13:37
This is my work-in=progress personal menu for the Livecode IDE "watch" or "recent changes" menu.
--> MetaData
-
license: GPLv3
name: Global | ScriptEditor | Recent | Watch | Menu
type: controller
copyright: David Bovill
license: GPLv3
version: 0.9
/*
@opn
opn / script,stack 'Global | Gist | Menu'
Created August 17, 2016 13:18
This menu is for the LIvecode IDE recent changes menu.
--> MetaData
-
license: GPLv3
name: Global | Gist | Menu
type: controller
version: 0.1
--> Global | Gist | Menu
-
andre,https://gist.github.com/opn/4cc35bc7818c0df1501f713c2d9384cd
jaque,https://gist.github.com/opn/4cewqr5bc7818c0df150124713c2d9384cd
@opn
opn / script,stack 'map.lc'
Created June 23, 2016 15:29
map-transport script for geo-encoded images and Wikipedia page references.
on index
put fedwiki_GetDroppedUrl ($_POST_RAW) into droppedURL
if droppedURL is empty then
fedwiki_ExitAndReturnError "Nothing dropped", "Error"
end if
set the itemdelimiter to "?"
switch
case matchtext (droppedURL, "^https://tools.wmflabs.org/geohack/geohack.php\?pagename=(.+)&params=(.+)", pageName, geoInfo)
-- put "https://tools.wmflabs.org/geohack/geohack.php?pagename=Bilbao&params=43_15_25_N_2_55_25_W_region:ES_type:city" into someURL
@opn
opn / script,stack 'fedwiki.lc'
Created June 19, 2016 06:31
A set of tools for manipulating Fedwiki pages.
on index
put fedwiki_GetDroppedUrl ($_POST_RAW) into droppedURL
put fedwiki_ConstructErrorJSON (droppedURL &CR&CR& $_POST_RAW) into errorJSON
fedwiki_ReturnJSON errorJSON
end index
on fork_Cleaner
put fedwiki_GetDroppedUrl ($_POST_RAW) into droppedURL
put fedwiki_CleanLastLineUpJournal (droppedURL, "create,fork", "fedwiki-transport") into cleanJSON
fedwiki_ReturnJSON cleanJSON
@opn
opn / gist:280754d59d258305731e5fdcc1d2a15d
Created April 23, 2016 11:19
Nginx with LUA installation on OSX
$ brew update
Updated Homebrew from 2921795 to c20622a.
Updated 1 tap (homebrew/core).
==> New Formulae
parquet-tools
==> Updated Formulae
buku gst-plugins-good kubernetes-cli
gst-editing-services gst-plugins-ugly solr
gst-libav gst-python tippecanoe
gst-plugins-bad gst-validate
@opn
opn / handler: command daemon_RouteRequest
Created April 16, 2016 16:33
A handler for routing.
command daemon_RouteRequest requestArray
-- this is the core handler that lib_Daemon dispatches
set the itemdelimiter to "/"
request_DeconstructArray requestArray, socketID, someMethod, someRoute, queryString, requestUrl
switch someMethod
case "GET"
process_GET someRoute, socketID, requestArray
break
case "POST"
process_POST someRoute, socketID, requestArray