Skip to content

Instantly share code, notes, and snippets.

Right ( GetFieldName ( Self ) ; Length ( GetFieldName ( Self ) ) - Position ( GetFieldName ( Self ) ; ":" ; 1 ; 2 ) )
@seanwalsh
seanwalsh / phone-format
Last active September 3, 2015 14:41
Based off of https://www.briandunning.com/cf/391. Added comments to help a developer understand recursive functions.
Let(
[
NumbersOnly = Filter ( Phone; "0123456789" ); // make sure we are only dealing with numerals
NewNumber = Right ( NumbersOnly; Length ( NumbersOnly ) - 1 ); // trim the string by 1 for the next recursive call
NewFormat = Right ( Format; Length ( Format ) - 1 ) // trim the string by 1 for the next recursive call
];
Case (
<?php
# Make sure and ID was passed.
if ( isset ( $_GET['id'] ) ) {
# Create variables for search.
$id = $_GET['id'];
# Perform search.
$query = " SELECT type, content, file_name
FROM asset
@seanwalsh
seanwalsh / base_table
Created April 25, 2015 01:50
Base fields I use in all tables.
CREATE TABLE `db`.`table` (
`zpk_id` TEXT NULL,
`zpk_recid` INT NOT NULL AUTO_INCREMENT,
`zrc_by` VARCHAR(45) NULL,
`zrc_on` TIMESTAMP NULL,
`zrm_by` VARCHAR(45) NULL,
`zrm_on` TIMESTAMP NULL,
PRIMARY KEY (`zpk_recid`));
@seanwalsh
seanwalsh / gist:a19392a7477e1fdeff7d
Created April 24, 2015 18:40
Passing a script parameter through to a different file
"setLocalVariable ( \"~accountName\" ; \"Account Name\" ; 1 )"
Custom Function
PassScriptParameter ( Value )
Parameter
Value
Definition
Let ( [
xWord = "|" & Value & "|"; /* WHAT IS THE FILTER TERM WE ARE LOOKING FOR */
xCount = Length ( xWord ); /* COUNT THE LENGTH OF THE FILTER TERM */
@seanwalsh
seanwalsh / formatFilePath.txt
Created December 29, 2014 00:44
FileMaker custom function to create a file path.
/*
---------------------------------------------------------------
CUSTOM FUNCTION :: formatFilePath ( format )
---------------------------------------------------------------
formatFilePath © 2006 Sean Walsh
Developed by: Sean Walsh
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@seanwalsh
seanwalsh / customFunction.txt
Created December 29, 2014 00:43
FileMaker custom function documentation.
/*
customFunction 2006 Sean Walsh
Developed by: Developer Name
Format:
customFunction ( field )
Parameters:
field - any related field, repeating field, or set of non-repeating fields; or an expression that returns a field, repeating field, or set of non-repeating fields.
ul > li:after {
content: "|";
margin-left: 10px; }
ul > li:last-child:after {
content: ""; }
@seanwalsh
seanwalsh / clearfix.scss
Created August 7, 2014 13:04
Clearfix mixin
@mixin clearfix {
&:after {
content: "";
display: table;
clear: both;
}
}