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 Foundation | |
import CoreBluetooth | |
/* | |
This Swift script scans for Bluetooth devices and prints information about the active Bluetooth adapter. | |
It uses the CoreBluetooth framework to manage Bluetooth operations and the system_profiler command to fetch adapter details. | |
To compile & run: | |
```bash | |
swiftc -framework CoreBluetooth main.swift -o BLEScanner |
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
{ | |
"id": "flexible-sample", | |
"schema_version": "1.0", | |
"created_at": "2022-04-13T22:11:39.000Z", | |
"updated_at": "2022-04-13T22:11:39.000Z", | |
"tags": ["development"], | |
"ble_registered_devices": [ | |
{ | |
"name": "Polar H10 821A5D29", | |
"services": ["heart-rate", "battery"], |
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
{ | |
"name": "allegations", | |
"children": [ | |
{ | |
"name": "Bribery / Official Corruption", | |
"children": [ | |
{ | |
"name": "An Act To Circumvent Criminal Prosecution", | |
"value": 1 | |
}, |
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
{ | |
"name": "allegations", | |
"children": [ | |
{ | |
"name": "Bribery / Official Corruption", | |
"children": [ | |
{ | |
"name": "An Act To Circumvent Criminal Prosecution", | |
"value": 25 | |
}, |
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
category | year | count | |
---|---|---|---|
Bribery / Official Corruption | 2004 | 1 | |
Bribery / Official Corruption | 2006 | 1 | |
Bribery / Official Corruption | 2007 | 3 | |
Bribery / Official Corruption | 2008 | 2 | |
Bribery / Official Corruption | 2009 | 1 | |
Bribery / Official Corruption | 2014 | 2 | |
Bribery / Official Corruption | 2015 | 2 | |
Conduct Unbecoming (Off-Duty) | 2000 | 4 | |
Conduct Unbecoming (Off-Duty) | 2001 | 15 |
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
Bribery / Official Corruption | 2004 | 1 | |
---|---|---|---|
Bribery / Official Corruption | 2006 | 1 | |
Bribery / Official Corruption | 2007 | 3 | |
Bribery / Official Corruption | 2008 | 2 | |
Bribery / Official Corruption | 2009 | 1 | |
Bribery / Official Corruption | 2014 | 2 | |
Bribery / Official Corruption | 2015 | 2 | |
Conduct Unbecoming (Off-Duty) | 2000 | 4 | |
Conduct Unbecoming (Off-Duty) | 2001 | 15 |
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
category | year | count | |
---|---|---|---|
Bribery / Official Corruption | 2002 | 1 | |
Bribery / Official Corruption | 2003 | 2 | |
Bribery / Official Corruption | 2005 | 1 | |
Bribery / Official Corruption | 2006 | 1 | |
Bribery / Official Corruption | 2007 | 2 | |
Bribery / Official Corruption | 2008 | 2 | |
Bribery / Official Corruption | 2009 | 2 | |
Bribery / Official Corruption | 2010 | 2 | |
Bribery / Official Corruption | 2011 | 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
category | year | count | |
---|---|---|---|
Bribery / Official Corruption | 2000 | 27 | |
Bribery / Official Corruption | 2001 | 21 | |
Bribery / Official Corruption | 2002 | 13 | |
Bribery / Official Corruption | 2003 | 13 | |
Bribery / Official Corruption | 2004 | 6 | |
Bribery / Official Corruption | 2005 | 14 | |
Bribery / Official Corruption | 2006 | 20 | |
Bribery / Official Corruption | 2007 | 36 | |
Bribery / Official Corruption | 2008 | 36 |
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 Foundation | |
extension Array { | |
subscript (lookup index: Index) -> Element? { | |
return indices.contains(index) ? self[index] : nil | |
} | |
} | |
let array = [1,2,3,4,5] | |
array[lookup: 7] // nil |
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 Foundation | |
extension String { | |
func isUppercased(at: Index) -> Bool { | |
let range = at..<self.index(after: at) | |
return self.rangeOfCharacter(from: .uppercaseLetters, options: [], range: range) != nil | |
} | |
} | |
extension Character { |
NewerOlder