Skip to content

Instantly share code, notes, and snippets.

View JKalash's full-sized avatar
🏠
Working from home

Joe Kalash JKalash

🏠
Working from home
View GitHub Profile
@JKalash
JKalash / JKHeatMapEngine.swift
Created February 10, 2018 19:18
JKHeatMapEngine
// JKHeatMapEngine.swift
// JKTinder
// Created by Joseph Kalash on 2/10/18.
// Copyright © 2018 Joseph Kalash. All rights reserved.
import Alamofire
import DeepDiff
// Note: This manager only deals with profile IDs and does not store any other info. Once user selectes a node in the
// cluster data, the array of profileIDs are passed to the next VC where the profile details are fetched and displayed to the user
@JKalash
JKalash / JKTrilateration.swift
Last active June 11, 2019 09:04
Trilateration algorithm in Swift 3. [Requires VectorMath.swift]
//
// JKTrilateration
//
// Created by Joseph Kalash on 6/9/17.
// Copyright © 2017 Joseph Kalash. All rights reserved.
//
import Foundation
extension Double {
@JKalash
JKalash / Date+Today.swift
Last active March 17, 2017 14:18
isToday var for Date struct
extension Date {
var isToday : Bool {
let cal = Calendar.current
var components = cal.dateComponents([.era, .year, .month, .day], from: Date())
let today = cal.date(from: components)!
components = cal.dateComponents([.era, .year, .month, .day], from: self)
let thisDate = cal.date(from: components)!
return (today as NSDate).isEqual(to: thisDate)
}
@JKalash
JKalash / isArabicCharacter.swift
Last active March 8, 2017 09:00
Swift 3 extension to the UnicodeScalar struct holding an isArabic property
extension UnicodeScalar {
var isArabic : Bool {
switch value {
case 0x0600 ... 0x06FF, //Arabic 255 characters
0x0750 ... 0x077F, //Arabic Supplement 48 characters
0x08A0 ... 0x08FF, //Arabic Extended-A 73 characters
0xFB50 ... 0xFDFF, //Arabic Presentation Forms-A 611 characters
0xFE70 ... 0xFEFF, //Arabic Presentation Forms-B 141 characters
0x10E60 ... 0x10E7F, //Rumi Numeral symbols 31 characters
@JKalash
JKalash / JKalash_HSV_RGB.swift
Created December 29, 2016 15:43
Converts to and from HSV to RGB color spaces
//
// RGBtoHSV.swift
// Stalkie
//
// Created by Joseph Kalash on 12/29/16.
// Copyright © 2016 Joseph Kalash. All rights reserved.
//
struct RGB {
//Percent
@JKalash
JKalash / sample_push.php
Created October 6, 2016 00:55
Sample Push
<?php
function sendMessage(){
$text = "Hello Message";
$content = array("en" => $text);
$fields = array(
'app_id' => "9df877a0-ceed-4a6f-8237-a62364d3babf",
'included_segments' => array('All'),
'contents' => $content
);