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/bash | |
AUTHOR=$(git config user.name) | |
DATE=$1 | |
echo "folder;date;comment" | |
for D in *; do | |
if [ -d "${D}" ]; then | |
# echo $D | |
cd $D | |
git log \ | |
--no-merges \ |
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
/// Nearest neigbour to a defined point. | |
let nearest = tree.element(nearestTo: float2(0, 0)) | |
/// You may filter for different types (classes) when performing | |
/// a nearest element search. | |
let nearestLocation = tree.element( | |
nearestTo: float2(0, 0), | |
type: CLLocation.self) | |
/// All of the elements in the quadtree node this point would be placed in. |
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
// Let's add a simple CLLocation to the tree. | |
let location = CLLocation( | |
latitude: item.latitude, | |
longitude: item.longitude) | |
tree.add(location, at: float2(item.latitude, item.longitude)) | |
// And then remove it. | |
tree.remove(location) |
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
let tree = BMQuadtree( | |
boundingQuad: boundingQuad, | |
minimumCellSize: 3) |
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
input { | |
tcp { | |
port => 5000 | |
# You need to have the json_lines plugin installed | |
codec => json_lines | |
# It is necessary to configure the SSL properly. Otherwise | |
# the logs wont make it to ES. | |
ssl_enable => true |
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
// Being online asserts the online navigation option. | |
// And retracts the offline option. | |
self.add(GKRule(blockPredicate: { ruleSystem -> Bool in | |
return Reachability.isOnline == true | |
}, action: { ruleSystem in | |
log.verbose("Rule 1: User is online") | |
ruleSystem.assertFact("navigableRoute") | |
ruleSystem.retractFact("offlineNavigableRoute") | |
})) |
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
// Random number between 1 and 6 | |
let d6 = GKRandomDistribution.d6() | |
d6.nextInt() | |
// 20-sided die? Done. | |
let d20 = GKRandomDistribution.d20() | |
d20.nextInt() | |
// Random number between 5 and 10 | |
GKRandomDistribution( |
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
{ | |
"version": 8, | |
"name": "Klokantech Terrain", | |
"metadata": { | |
"mapbox:autocomposite": false, | |
"mapbox:type": "template", | |
"maputnik:renderer": "mbgljs", | |
"openmaptiles:version": "3.x", | |
"openmaptiles:mapbox:owner": "openmaptiles", | |
"openmaptiles:mapbox:source:url": "mapbox://openmaptiles.4qljc88t" |
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
do { | |
// Closure | |
try self.doStuff(string: "Some string") { result in | |
print(result) | |
} | |
// Promise | |
let promise = try self | |
.doStuff(string: "Some other string") |
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
@discardableResult func doStuff( | |
string: String, | |
completion: (([String]) -> Void)? = nil) throws -> Promise<[String]> {} |
NewerOlder