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 java.util.Properties | |
val localProperties = Properties() | |
val localPropertiesFile = file(rootProject.file("local.properties")) | |
if (localPropertiesFile.exists()) { | |
localProperties.load(localPropertiesFile.inputStream()) | |
} | |
val flutterRoot = localProperties.getProperty("flutter.sdk") |
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
# Firestore Security Rules - Examples | |
Default: Every resource is locked down by default, and its a redundant rule, but can be a good reminder in the start of rules file | |
service cloud.firestore { | |
match /databases/{database}/documents { | |
match /{document=\*\*} { | |
allow read, write: if false; | |
} | |
} | |
} |
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 BookPage extends StatefulWidget { | |
final String url; | |
const BookPage(this.url, {Key? key}) : super(key: key); | |
@override | |
_BookPageState createState() => _BookPageState(); | |
} | |
class _BookPageState extends State<BookPage> { |
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
// Created by Helge Heß 2021-06-17 | |
import Foundation | |
// They use obfuscated names to hide it from us! | |
import JavaScriptCore | |
/// Setup our async/await runtime. | |
let runtime = JSContext()! |
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
//Song converter utility for the piano tiles 2 templates on SellMyApp https://www.sellmyapp.com/downloads/piano-tiles-template/ | |
using UnityEngine; | |
using System.Collections; | |
using MovementEffects; | |
using Mio.TileMaster; | |
using System.Collections.Generic; | |
using System; | |
//using System.Runtime.Serialization.Formatters.Binary; |
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
// MIT License | |
// | |
// Copyright (c) 2019 Simon Lightfoot | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
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 Cocoa | |
import JavaScriptCore | |
/// Something that can be represented as a `JSValue`. | |
protocol JSValueRepresentable { | |
/// The `JSValue` for this thing. | |
var jsValue: JSValue { get } | |
} |
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 loadCatFact(completion:@escaping (String) -> Void) { | |
let session = URLSession.shared | |
if let url = URL(string: "https://catfact.ninja/fact") { | |
let task = session.dataTask(with: url) { (data, response, error) in | |
if error == nil, let data = data { | |
let factData = String(data: data, encoding: .utf8) | |
completion(factData ?? "") | |
} | |
} | |
task.resume() |
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
if let context = JSContext() { | |
let asynchronousCall: @convention(block) (JSValue) -> Void = { (callback) in | |
loadCatFact { (catFact) in | |
callback.call(withArguments: [catFact]) | |
} | |
} | |
let printText:@convention(block) (String) -> Void = { (text) in | |
print("\(text)") | |
} |
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 JavaScriptCore | |
extension JSContext { | |
subscript(key: String) -> Any { | |
get { | |
return self.objectForKeyedSubscript(key) | |
} | |
set{ | |
self.setObject(newValue, forKeyedSubscript: key as NSCopying & NSObjectProtocol) | |
} |
NewerOlder