Skip to content

Instantly share code, notes, and snippets.

View dansmith65's full-sized avatar

Dan Smith dansmith65

View GitHub Profile
@dansmith65
dansmith65 / ExecuteSQL
Last active April 2, 2018 18:13
ExecuteSQL template for FileMaker which allows for viewing the query in the data viewer while debugging, and testing for an error.
Let ( [
$sqlQuery =
"SELECT "
& SQLTableAndField ( field )
& "¶FROM "
& SQLTable ( field )
& "¶LEFT JOIN "
& SQLTable ( field )
& "¶ON "
& SQLTableAndField ( field )
@dansmith65
dansmith65 / XPath Parse With Namespace.java
Last active December 20, 2015 21:38
ScriptMaster function, for use in a FileMaker plug-in.
// XPathParseWithNamespace ( someXML ; xpathQuery ; namespaceList )
// adapted from this code: http://www.java2s.com/Code/Java/XML/implementsNamespaceContext.htm
// and the prior XPath Parse function in ScriptMaster
import javax.xml.XMLConstants;
import javax.xml.namespace.NamespaceContext;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathFactory;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathExpressionException;
@dansmith65
dansmith65 / GetDelimitedValue.fmfn
Last active December 29, 2015 03:39
In FileMaker, return value in specified location of delimited text.
/**
* =====================================
* GetDelimitedValue ( text ; delimiter ; occurrence )
*
* RETURNS:
* Value in specified location of delimited text.
*
* PARAMETERS:
* text = (text) delimited data
* delimiter = (text) single character used to separate values
@dansmith65
dansmith65 / VirtualBoxFixNIC.cmd
Created December 13, 2013 20:28
Fix issue with VirtualBox Host-Only Network adapter in Windows by adding *NdisDeviceType=1 to registry.
@ECHO OFF
ECHO.-------------------------------------------------------------------------------
ECHO.
ECHO. VirtualBoxFixNIC.cmd
ECHO.
ECHO. Created on 2013-DEC-13 by Dan Smith http://scr.im/dansmith
ECHO.
ECHO. Fix issue with VirtualBox Host-Only Network adapter in Windows by adding
ECHO. *NdisDeviceType=1 to registry.
ECHO.
@dansmith65
dansmith65 / ListContains.fmfn
Created January 4, 2014 00:48
FileMaker Custom Function: ListContains ( ValueList ; ValuesToTestExistence )
/* ListContains ( ValueList ; ValuesToTestExistence )
PURPOSE:
Test if all specified values exist in a list.
PARAMETERS:
ValueList (text) values to search in
ValuesToTestExistence (text) value(s) to search for
RETURNS:
@dansmith65
dansmith65 / #SanitizeName.fmfn
Created May 12, 2014 17:52
FileMaker Custom function: Remove characters that are not valid for use in a Let() variable name.
/**
* ============================================================================
* #SanitizeName ( name )
*
* PURPOSE:
* Remove characters that are not valid for use in a Let() variable name.
*
* RETURNS:
* Text that is a valid Let() variable name, if an error occurs, the original text is returned.
*
@dansmith65
dansmith65 / RowContainingValue.fmfn
Created January 16, 2015 18:03
RowContainingValue ( data ; firstColumnValue ; columnSeparator ; rowSeparator )
/**
* =====================================
* RowContainingValue ( data ; firstColumnValue ; columnSeparator ; rowSeparator )
*
* RETURNS:
* First row from an array of data where the first columns value matches.
* WITHOUT trailing column separator.
*
* PARAMETERS:
* data: array of data with single characters delimiting columns/rows
@dansmith65
dansmith65 / #.fmfn
Created March 18, 2015 22:07
in-progress version of # custom function for FileMaker
/**
* =====================================
* # ( name ; value )
*
* RETURNS:
* An name-value pair in Let notation.
*
* PARAMETERS:
* name: The name for the returned name-value pair. name can be any value
* that would be a valid Let() variable name.
@dansmith65
dansmith65 / VerifyVariablesNotEmpty.fmfn
Created March 23, 2015 17:20
test version of VerifyVariablesNotEmpty custom function for FileMaker
/**
* =====================================
* VerifyVariablesNotEmpty ( nameList )
*
* RETURNS:
* True (1) if a locally scoped $variable matching each value in nameList
* is not empty; False (0) otherwise.
*
* PARAMETERS:
* nameList: A return-limited list of names to check. Names do not need to
@dansmith65
dansmith65 / Get-TodoistBackup.ps1
Created May 17, 2016 18:55
Powershell script to download the latest backup from Todoist
# Get-TodoistBackup.ps1
# Created By: Daniel Smith dan@dansmith65.com
#
# Download the latest backup from Todoist
#
$token = ""
# get list of backups from Todoist