This file contains hidden or 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 requests | |
import json | |
url = "https://fcm.googleapis.com/fcm/send" | |
project_key = "firebase-dashboard-project-key" | |
headers = { | |
"Authorization": "key={}".format(project_key), | |
"Content-Type": "application/json" | |
} |
This file contains hidden or 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
// URL Here: | |
var sampleURL = "http://domain.com/#order/food=chicken/drink=coke"; | |
// Function to parse the URL | |
function parseURL(inputURL) { | |
/** | |
Strategy: | |
This file contains hidden or 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
func textForToday() -> NSAttributedString | |
{ | |
let sefira = Sefira() | |
let day = sefira.dayToUseForDisplay() | |
let prayers : KCSefiraPrayerAddition = self.flagsForPrayerComponentsEnabledByUser() | |
let storedCustom = SettingsManager.sharedManager.custom() | |
if let custom = KCSefiraCustom(rawValue: storedCustom) { | |
sefiraFormatter.custom = custom | |
} |
This file contains hidden or 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
#!/bin/sh | |
# | |
#################################### | |
# iTunes Command Line Control v1.0 | |
# written by David Schlosnagle | |
# created 2001.11.08 | |
#################################### | |
showHelp () { | |
echo "-----------------------------"; |
This file contains hidden or 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 hashlib | |
import sys | |
try: | |
website_name = sys.argv[1] | |
hash_value = hashlib.md5(website_name) | |
print(hash_value.hexdigest().upper() + ".png") | |
except Exception, e: |
This file contains hidden or 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 | |
class SubmissionManager: NSObject { | |
static let sharedManager = SubmissionManager() | |
var serverURLComponents : NSURLComponents = NSURLComponents() | |
private let keyDefaultsServerAddress : String = "com.company.serverURL" | |
This file contains hidden or 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
func testTask() -> NSURLSessionDataTask? { | |
let components = NSURLComponents() | |
components.scheme = self.serverURLComponents.scheme | |
components.host = self.serverURLComponents.host | |
components.port = self.serverURLComponents.port | |
components.path = "/" | |
guard let url = components.URL else { | |
print("Failed to build URL from components. \(components)") |
This file contains hidden or 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
class ObjectQueue<T : NSObject> { | |
private var used : [T] = [] | |
private var free : [T] = [] | |
/** Recycle or create object. */ | |
func dequeueObject () -> T { | |
var object : T | |
This file contains hidden or 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
// | |
// AgreementView.swift | |
// Intake | |
// | |
// Created by Moshe Berman on 12/11/15. | |
// Copyright © 2015 Moshe Berman. All rights reserved. | |
// | |
import UIKit |
This file contains hidden or 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
// | |
// AgreementInput.swift | |
// Intake | |
// | |
// Created by Moshe Berman on 1/14/16. | |
// Copyright © 2016 Moshe Berman. All rights reserved. | |
// | |
import Foundation |