Skip to content

Instantly share code, notes, and snippets.

View SimpleSensing_ESP32.ino
#include <BLEDevice.h>
#include <BLEServer.h>
#include <BLEUtils.h>
#include <BLE2902.h>
uint8_t note = 38;
int SNARE[6] = {150, 4000, 38, 3, 0, 0}; //{threshold, sensitivity, note(no use), flag, velocity, last peakValue}
boolean snareFlag = false;
BLECharacteristic *pCharacteristic;
@sabas1080
sabas1080 / ESP32_HID.ino
Last active Apr 27, 2021
Example of HID Keyboard BLE with ESP32
View ESP32_HID.ino
/*
Copyright (c) 2014-2020 Electronic Cats SAPI de CV. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
View k8s-dashboard-admin-user.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: admin-user
@winggundamth
winggundamth / docker-compose.yml
Created Apr 28, 2018
Elasticsearch Cluster + Grafana Docker Compose File
View docker-compose.yml
version: '3'
services:
es1:
image: docker.elastic.co/elasticsearch/elasticsearch:6.2.4
container_name: es1
environment:
cluster.name: "docker-cluster"
bootstrap.memory_lock: "true"
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
TAKE_FILE_OWNERSHIP: "true"
@MightyPork
MightyPork / usb_hid_keys.h
Last active May 10, 2021
USB HID Keyboard scan codes
View usb_hid_keys.h
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
@morganrallen
morganrallen / esp32.md
Last active Dec 24, 2016
ESP32 hacking notes
View esp32.md

Basic hookup

As I plan to make a custom breakout board I wanted to solder as few connections as possible. I was able to boot the device, with UART (out at least) soldering the following.

PIN NAME
0 GND
1 3V3
2 EN
@blundell
blundell / WatchFaceLifecycle-ExampleActivity.java
Last active Aug 29, 2015
Unofficial Base WatchFace Listener
View WatchFaceLifecycle-ExampleActivity.java
public class ExampleActivity extends Activity implements WatchFaceLifecycle.Listener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_my_layout);
WatchFaceLifecycle.attach(this, savedInstanceState, this);
}
@Override
@PomepuyN
PomepuyN / Watch face Ambient mode detection
Last active Nov 5, 2018
Allow to detect Ambient mode to switch Watch face display on Wear devices
View Watch face Ambient mode detection
Handler handler = new Handler(Looper.getMainLooper());
final DisplayManager displayManager = (DisplayManager) getSystemService(Context.DISPLAY_SERVICE);
displayManager.registerDisplayListener(new DisplayManager.DisplayListener() {
@Override
public void onDisplayAdded(int displayId) {
}
@Override
@h4cc
h4cc / rsyslog_openvz_fix.sh
Created Nov 5, 2013
Using rsyslog on OpenVZ like Proxmox can lead to a problem, which symtoms are mostly >= 100% CPU usage of rsyslogd. Error message is "Cannot read proc file system: 1 - Operation not permitted.", because the file /proc/kmsg could not be read.
View rsyslog_openvz_fix.sh
sed -i -e 's/^\$ModLoad imklog/#\$ModLoad imklog/g' /etc/rsyslog.conf
service rsyslog restart
# Source: https://github.com/devananda/openvz-tools/blob/master/install-openvz-kernel.sh