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
# Creation Date: November 3, 2018 | |
:local Version "2.0" | |
:local LASTUPDATE "05/10/2019" | |
# Tested with RouterOS 6.43.4 | |
# | |
# Mikrotik script to implement QoS on internet connections. | |
# The script makes use of Address Lists, Firewall rules (Mangle) for connection tagging, and Queue Trees. | |
# The script will remove applied rules from previous runs before applying. | |
# |
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 getLux() { | |
guard let serviceType = IOServiceMatching("AppleLMUController") else { | |
debugPrint("No ambient light sensor") | |
return | |
} | |
// get and release service | |
let service = IOServiceGetMatchingService(kIOMasterPortDefault, serviceType) | |
defer { | |
IOObjectRelease(service) |
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
/* Algorithm for Efficient Chunked File Reading in C++ | |
* | |
* The MIT License (MIT) | |
* | |
* Copyright 2014 Andrew Schwartzmeyer | |
* | |
* 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, |