Skip to content

Instantly share code, notes, and snippets.

@kimonostereo
kimonostereo / TransmitSync.applescript
Last active July 7, 2020 16:45
Applescript for Panic's Transmit to sync a remote directory to a local directory with the option set to delete orphaned items. Modified from original script found here: http://www.mindthegapp.com/?p=4193
tell application "Transmit"
with timeout of (240 * 60) seconds
activate
tell application "Transmit"
-- Prevent interactive alerts from popping up during script execution
set SuppressAppleScriptAlerts to true
-- Set some variables to values to be used later in the script
set myFTPServer to item 1 of (favorites whose name is "YourFavoriteHere")
set pathToMainBackupDirectory to "/Volumes/Backups/Daily Backups/Tuesday"
@kimonostereo
kimonostereo / Filemaker PHP - Simple Search
Created March 18, 2016 22:48
Simple search using $fullname as the submitted search criteria.
<?php
include ("/www/fmphp/access.php");
//'respondent_exists' will be set if the user is coming from the Respondent.php page
//Grab the user input from the $_POST data
$respondent_data = array(
'firstname' => $_POST['firstname'],
@kimonostereo
kimonostereo / Filemaker PHP - Paginated Self Contained Search
Created March 18, 2016 21:29
This works with PHP Pagination code. Page uses itself as the actual form and the return values.
@kimonostereo
kimonostereo / Filemaker PHP - Find EXACT Record for Editing
Created March 18, 2016 21:01
Use this code to search for a record, then grab the record ID
<?php
include ("/www/htdocs/fmphp/access.php");
$find = $fm->newFindCommand('Table');
// use == for an exact search!
$find->addFindCriterion('id',"==". $_POST['id']);
$find->addFindCriterion('student_id',"==". $_POST['student_id']);
$result = $find->execute();
@kimonostereo
kimonostereo / Filemaker PHP - Commit edits to a record
Created March 18, 2016 21:00
Using in combination with the snippet Find EXACT Record for Editing, you can then put this on the results page to commit edits to a record.
<?php
include ("/www/htdocs/fmphp/access.php");
// grab the posted info and convert to vars
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$current_grade = $_POST['current_grade'];
$grad_year = $_POST['grad_year'];
<mt:Assets>
<mt:Section strip_linefeeds="1" replace=" ","">
<mt:If tag="mt:AssetType" eq="image"><mt:ignore><!-- if the asset type is an image, then... --></mt:ignore>
<mt:ignore><!-- set the variables for alignment and thumbnail size --></mt:ignore>
<mt:AssetyleneAlign setvar="align">
<mt:AssetyleneThumbWidth setvar="thumb_width">
<mt:ignore><!-- div for asset alignment --></mt:ignore>
<div class="asset-image<mt:If name="align" eq="left"> img-left</mt:If><mt:If name="align" eq="right"> img-right</mt:If>">
<mt:ignore><!-- if the image is a thumbnail... --></mt:ignore>
<mt:If tag="AssetyleneThumb">

Keybase proof

I hereby claim:

  • I am kimonostereo on github.
  • I am kimonostereo (https://keybase.io/kimonostereo) on keybase.
  • I have a public key whose fingerprint is B8CE DAC3 18DF B23D 9C40 F4C4 71EE 165F 9133 F979

To claim this, I am signing this object:

#!/bin/sh
# This script installs AutoMySQLBackup in home directory on shared web server.
# Create prerequisite directories and move into $HOME/downloads folder:
mkdir -p $HOME/downloads
mkdir -p $HOME/etc/automysqlbackup
mkdir -p $HOME/bin
mkdir -p $HOME/backup/mysql/automysqlbackup
cd $HOME/downloads