Skip to content

Instantly share code, notes, and snippets.

View seanwalsh's full-sized avatar

Sean Walsh seanwalsh

View GitHub Profile
SELECT
table1.field1, table2.field1
FROM
table1
INNER JOIN
table2
ON
table1.primaryKey = table2.foreignKey
WHERE
table1.field2 = 'query'
@seanwalsh
seanwalsh / Change Title Tag OnBlur
Last active August 29, 2015 14:03
Change the title tag when the user goes to another window/tab.
window.onblur = function () { document.title = 'Your new HTML Title tag'; }
window.onfocus = function () { document.title = 'The default title tag'; }
@seanwalsh
seanwalsh / eula.css
Last active August 29, 2015 14:04
CSS to quickly format a EULA or any legal document. Most basic elements will work but there are a few extra things needed.
body { margin: 15px;}
.bold { font-weight: bold; }
.caps { text-transform: uppercase; }
.center { text-align: center; }
.circle { list-style: circle; }
.smcaps { font-variant: small-caps; }
.unstyled { list-style: none; }
@seanwalsh
seanwalsh / Change Title Tag
Created July 25, 2014 13:12
A little bit of Javascript to change the title of a page after loosing focus. For example, switching to another window or tab.
// Change Title Tag on Blur
var titleCurrent = document.title;
var titleList = [
"Hey, over here.",
"Don't you forget about me",
"Please come back"
];
var titleIndex = "";
function titleRandom(){
@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.
@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:
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 / 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 (
Right ( GetFieldName ( Self ) ; Length ( GetFieldName ( Self ) ) - Position ( GetFieldName ( Self ) ; ":" ; 1 ; 2 ) )
@seanwalsh
seanwalsh / code.md
Last active December 30, 2015 00:08

JavaScript

for (i=0; i < n; i++) {
 // code
}

PHP

for ($i = 0; $i &lt; $n; $i++) {