This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import Kingfisher | |
class EventTableViewCell: UITableViewCell { | |
@IBOutlet weak var eventPhoto: UIImageView! | |
@IBOutlet weak var eventDescription: UITextView! | |
// constraint | |
var aspectConstraint: NSLayoutConstraint? { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// refresh token -> (token, expiry, error) | |
class func refreshToken(for auth: String, completion: @escaping (String, Date, String) -> Void) { | |
guard let path = UserDefaults.standard.string(forKey: "fm-db-path"), | |
let baseURL = URL(string: path) else { return } | |
let url = baseURL.appendingPathComponent("/sessions") | |
let expiry = Date(timeIntervalSinceNow: 900) // 15 minutes | |
var request = URLRequest(url: url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$record = $result->getRecords()[0]; | |
$pk = $record->getField('__pk_volunteerID'); | |
$name = $record->getField('firstName'); | |
// new related record | |
$log = $fm->newAddCommand('TimeEntries'); | |
$log->setField('__fk_volunteerID', $pk); | |
$log->setField('hours', $h); // value from $body using intval() and strpos($,'hour') | |
$_ = $log->execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// ... | |
if ( FileMaker::isError($result) ) { | |
$response->sms("I couldn't find an artist for this cell number."); | |
} else { | |
$record = $result->getRecords()[0]; | |
$url = $record->getField('url'); | |
$response->sms("Roger that. Here's a link to your record:\n\n$url."); | |
} | |
// send |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
function sendArtistURL() { | |
$request = $fm->newFindCommand('ArtistDetail'); | |
$request->addFindCriterion('phoneCalc', '=='.$from); | |
$result = $request->execute(); | |
// ... (cont'd) | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
function fallbackMessage() { | |
$response->sms("Not sure what to make of that."); | |
echo $response; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
switch ($body) { | |
case 'profile': | |
sendArtistURL(); | |
default: | |
fallbackMessage(); | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$from = $_REQUEST['From']; // +12225551234 | |
$body = trim( strtolower( $_REQUEST['Body'] )); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require('../Twilio/Services/Twilio.php'); | |
require('../_fm/connect.php'); | |
$response = new Services_Twilio_Twiml(); // for later | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src='http://your.path.to/lastfm.js'></script> | |
<div id='lastfm'></div> |
NewerOlder