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 defer src="/__/firebase/8.3.1/firebase-firestore.js"></script> | |
<script defer src="/__/firebase/8.3.1/firebase-functions.js"></script> |
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 Foundation | |
import UIKit | |
var iconDictonary: [[String:Any]] = [ | |
[ | |
"icon":"food", | |
"tags":["food", "dinner","breakfast","lunch","brunch","meal","feed"] | |
], | |
[ | |
"icon":"airport", |
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
extension String { | |
var isBlank: Bool { | |
get { | |
let trimmed = self.trimmingCharacters(in: NSCharacterSet.whitespaces) | |
return trimmed.isEmpty | |
} | |
} | |
} |
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
Parse.Cloud.define("crop_multiple_sizes_image.js", function(request, response) { | |
var url = request.params.imageURL; | |
var returnImagesArray = []; | |
// Requires two packages to make this happen. | |
var _ = require('underscore.js'); | |
var Image = require("parse-image"); | |
// Default images sizes. | |
var image_card_2x = [540, 350]; |
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 cleanPhoneNumber(phoneString){ | |
//Use .match and regex to cut out the crap from the phone number | |
match = phoneString.match(/\D*\(?(\d{3})?\)?\D*(\d{3})\D*(\d{4})\D*(\d{1,8})?/); | |
//Assuming there are 3 parts... you can add more checks for arrays if you run into the issue of extensions. | |
if(match[3] === 'undefined'){ | |
if(match[2] === 'undefined'){ | |
if(match[1] === 'undefined'){ | |
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
//Note: I did not write all of this code. Some was provided by IU. I am only showing an efficient method to | |
//making sure they are an IU student. I wrote this code for use on the iuifc.org website. Any problems? @liambolling | |
//You may not need this. I found it helped to make sure to ask for auth. | |
session_start(); | |
//This will send the user everytime to CAS to authenticate. | |
//Fixes the whole "I closed my browser but not out of CAS" thing. |
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
//This is the exact code that we use to display recent events on our homepage and through out the website. | |
//Import the file | |
$file = 'https://iuifc.org/wp-content/themes/iuifc/json-data/public_calendar_5_recent.json'; | |
//This url will just show all events in order they were created. | |
//https://iuifc.org/wp-content/themes/iuifc/json-data/public_calendar_data.json | |
//Decode them into something we can work with | |
$json_array = json_decode(file_get_contents($file), true); |