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
#include <BLEDevice.h> | |
#include <BLEServer.h> | |
#include <BLEUtils.h> | |
#include <BLE2902.h> | |
#define DEVICE_NAME "Pomo Light #1" | |
#define RED_PIN 5 | |
#define GREEN_PIN 18 | |
#define BLUE_PIN 19 |
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
#!/usr/bin/env python3 | |
# Copyright © 2017 Kristof Toth <mrtoth@strongds.hu> | |
# This program is free software. It comes without any warranty, to the extent | |
# permitted by applicable law. You can redistribute it and/or modify it under the | |
# terms of the Do What The Fuck You Want To Public License, Version 2, | |
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. | |
from subprocess import call, Popen, PIPE, DEVNULL | |
from os import listdir, remove | |
from os.path import splitext, exists, join, split |
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 noble = require('noble'); | |
const { EventEmitter } = require('events'); | |
class PomoLight extends EventEmitter { | |
constructor(prefix, serviceUUID, writeUUID) { | |
super(); | |
this.prefix = prefix; | |
this.serviceUUID = serviceUUID; | |
this.writeUUID = writeUUID; |
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
{ | |
"state": "charging|discharging|off", | |
"voltage": 50.40, | |
"currents": { | |
"esc": { | |
"current": 0, | |
"energy": { | |
"charged": 0, | |
"discharged": 0 | |
} |
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
{ | |
"title": "Control + Function Keys to Media Control", | |
"rules": [ | |
{ | |
"description": "fn + f1 to display_brightness_decrement", | |
"manipulators": [ | |
{ | |
"type": "basic", | |
"from": { | |
"key_code": "f1", |
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
output # => ["clang version 5.0.0 (tags/RELEASE_500/final)", | |
"Target: x86_64-apple-darwin16.6.0", | |
"Thread model: posix", | |
"InstalledDir: /usr/local/opt/llvm/bin", | |
" \"/usr/local/Cellar/llvm/5.0.0/bin/clang-5.0\" \"-cc1\" \"-triple\" \"x86_64-apple-macosx10.12.0\" \"-Wdeprecated-objc-isa-usage\" \"-Werror=deprecated-objc-isa-usage\" \"-emit-obj\" \"-mrelax-all\" \"-disable-free\" \"-disable-llvm-verifier\" \"-discard-value-names\" \"-main-file-name\" \"bindgen.cpp\" \"-mrelocation-model\" \"pic\" \"-pic-level\" \"2\" \"-mthread-model\" \"posix\" \"-mdisable-fp-elim\" \"-masm-verbose\" \"-munwind-tables\" \"-faligned-alloc-unavailable\" \"-target-cpu\" \"penryn\" \"-target-linker-version\" \"278.4\" \"-dwarf-column-info\" \"-debugger-tuning=lldb\" \"-resource-dir\" \"/usr/local/Cellar/llvm/5.0.0/lib/clang/5.0.0\" \"-stdlib=libc++\" \"-fdeprecated-macro\" \"-fdebug-compilation-dir\" \"/Users/aniekis/Projects/Home/Desktop/C++/bindgen/clang\" \"-ferror-limit\" \" |
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
output # => ["clang version 5.0.0 (tags/RELEASE_500/final)", | |
"Target: x86_64-apple-darwin16.6.0", | |
"Thread model: posix", | |
"InstalledDir: /usr/local/Cellar/llvm/5.0.0/bin", | |
" \"/usr/local/Cellar/llvm/5.0.0/bin/clang-5.0\" \"-cc1\" \"-triple\" \"x86_64-apple-macosx10.12.0\" \"-Wdeprecated-objc-isa-usage\" \"-Werror=deprecated-objc-isa-usage\" \"-emit-obj\" \"-mrelax-all\" \"-disable-free\" \"-disable-llvm-verifier\" \"-discard-value-names\" \"-main-file-name\" \"bindgen.cpp\" \"-mrelocation-model\" \"pic\" \"-pic-level\" \"2\" \"-mthread-model\" \"posix\" \"-mdisable-fp-elim\" \"-masm-verbose\" \"-munwind-tables\" \"-faligned-alloc-unavailable\" \"-target-cpu\" \"penryn\" \"-target-linker-version\" \"278.4\" \"-dwarf-column-info\" \"-debugger-tuning=lldb\" \"-resource-dir\" \"/usr/local/Cellar/llvm/5.0.0/lib/clang/5.0.0\" \"-stdlib=libc++\" \"-fdeprecated-macro\" \"-fdebug-compilation-dir\" \"/Users/aniekis/Projects/Home/Desktop/C++/bindgen/clang\" \"-ferror-li |
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
module SerialPorts | |
struct PortMetadata | |
property name : String | |
property transport : String | |
property description : String? | |
property usbVID : Int32? | |
property usbPID : Int32? | |
property usbVendorName : String? | |
property usbProductName : String? | |
property usbSerialNumber : 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
# Lib | |
fun cf_string_get_c_string = CFStringGetCString(CfStringRef, UInt8*, CfIndex, UInt32) : Boolean | |
# Call | |
result = IOKit.cf_string_get_c_string(cf_path.as(IOKit::CfStringRef), out name, 300, IOKit::CFStringEncodingASCII) | |
pp String.new(name) | |
# Error |
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
➜ crystal git:(feature/opensll_pbkdf2_implementation) make std_spec | |
Using /usr/local/bin/llvm-config [version=5.0.0] | |
./bin/crystal build -o .build/std_spec spec/std_spec.cr | |
Undefined symbols for architecture x86_64: | |
"_PKCS5_PBKDF2_HMAC", referenced from: | |
_*OpenSSL::PKCS5::pbkdf2_hmac<Symbol, String, String, Int32, Int32>:Slice(UInt8) in O-penS-S-L-5858P-K-C-S-5.o | |
ld: symbol(s) not found for architecture x86_64 | |
clang: error: linker command failed with exit code 1 (use -v to see invocation) | |
Error: execution of command failed with code: 1: `cc "${@}" -o '/Users/aniekis/Projects/Home/Desktop/Crystal/crystal/.build/std_spec' -rdynamic -lyaml `/usr/local/bin/llvm-config --libs --system-libs --ldflags 2> /dev/null` -lstdc++ `command -v pkg-config > /dev/null && pkg-config --libs libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs libcrypto || printf %s '-lcrypto'` -lreadline -lgmp -lz -lxml2 -lpcre -lgc -lpthread /Users/aniekis/Projects/Home/Desktop/Crystal/cryst |