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
const GOOGLE_API_KEY = "XXXXX"; | |
const GOOGLE_GCM_URL = "https://fcm.googleapis.com/fcm/send"; | |
$fields = array( | |
'to' => $device_token, | |
'sound' => 'default', | |
'priority' => 'high', | |
'data' => array("title" => $this-title, | |
"message" => $this->message // You may add more data | |
) |
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 | |
// Get student email | |
$email = isset($_POST['email']) ? $_POST['email'] : die(); | |
// Include third party library classes | |
use PHPMailer\PHPMailer\PHPMailer; | |
use PHPMailer\PHPMailer\Exception; | |
require '../util/phpmailer/Exception.php'; | |
require '../util/phpmailer/PHPMailer.php'; |
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
// sourcery: AutoMockable | |
protocol FooProtocol { | |
func foo1() | |
func foo2() -> String | |
func foo3(str: String, int: Int) -> Int | |
} |
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
// sourcery: AutoMockable | |
protocol FooProtocol { | |
func foo1() | |
func foo2() -> String | |
func foo3(str: String, int: Int) -> Int | |
} |
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
class FooProtocolMock: FooProtocol { | |
//MARK: - foo1 | |
var foo1CallsCount = 0 | |
var foo1Called: Bool { | |
return foo1CallsCount > 0 | |
} | |
var foo1Closure: (() -> Void)? | |
func foo1() { |
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
{% for type in types.protocols where type|annotated:"MyFirstSpell" %} | |
{% for method in type.allMethods %} | |
// I found method {{method.shortName}} | |
{%endfor%} | |
{% endfor %} |
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
{% for type in types.protocols where type|annotated:"MyFirstSpell" %} | |
class MyFirstDayAtMagicalSchool { | |
{% for method in type.allMethods %} | |
//MARK: {{method.shortName}} transformed to frog-prefix | |
func frog_{{method.name}} {} | |
{%endfor%} | |
} | |
{% endfor %} |
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
// sourcery: MyFirstSpell | |
protocol BoomProtocol { | |
func boom1() | |
func boom2() -> String | |
func boom3(str: String, int: Int) | |
func boom4(args: String...) | |
} |
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
// Generated using Sourcery 1.6.0 — https://github.com/krzysztofzablocki/Sourcery | |
// DO NOT EDIT | |
class MyFirstDayAtMagicalSchool { | |
//MARK: boom1 transformed to frog-prefix | |
func frog_boom1() {} | |
//MARK: boom2 transformed to frog-prefix | |
func frog_boom2() {} | |
//MARK: boom3 transformed to frog-prefix | |
func frog_boom3(str: String, int: Int) {} |
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
// swiftlint:disable line_length | |
// swiftlint:disable variable_name | |
// ❤️ https://github.com/krzysztofzablocki/Sourcery/blob/master/Templates/Templates/AutoMockable.stencil | |
{% for import in argument.autoMockableImports %} | |
import {{ import }} | |
{% endfor %} | |
{% for import in argument.autoMockableTestableImports %} | |
@testable import {{ import }} | |
{% endfor %} | |
{% macro swiftifyMethodName name %}{{ name | replace:"(","_" | replace:")","" | replace:":","_" | replace:"`","" | snakeToCamelCase | lowerFirstWord }}{% endmacro %} |
OlderNewer