Skip to content

Instantly share code, notes, and snippets.

anoochit / Watch face Ambient mode detection
Last active Aug 29, 2015
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() {
public void onDisplayAdded(int displayId) {
anoochit / Watch face for Android Wear
Created Jul 17, 2014
Watch face for Android Wear
View Watch face for Android Wear
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
<uses-feature android:name="" />
<uses-permission android:name="" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
anoochit / wifi-rest.ino
Created Jul 30, 2014
wifi cc3000 rest api
View wifi-rest.ino
// Import required libraries
#include <Adafruit_CC3000.h>
#include <SPI.h>
#include <CC3000_MDNS.h>
#include <aREST.h>
// These are the pins for the CC3000 chip if you are using a breakout board
#define ADAFRUIT_CC3000_IRQ 3
#define ADAFRUIT_CC3000_VBAT 5
#define ADAFRUIT_CC3000_CS 10
anoochit / lm35-cc3000-xively.ino
Created Aug 4, 2014
CC3000 WiFi chip & Xively
View lm35-cc3000-xively.ino
This is a sketch to use the CC3000 WiFi chip & Xively
Written by Marco Schwartz for Open Home Automation
Modified code for read temperature from LM35
// Libraries
anoochit / rockmongo_mongo.json
Created Aug 8, 2014
geard orchestration example
View rockmongo_mongo.json
anoochit / config.yaml
Created Aug 21, 2014
sample cloud config for coreos
View config.yaml
hostname: coreos01
- name: docker.service
command: start
anoochit /
Last active Aug 29, 2015
read temperature from dht22 for raspberry pi
import sys
import time
import Adafruit_DHT
sensor = Adafruit_DHT.DHT22
pin = 4
while True:
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
anoochit / hc05.ino
Last active Dec 5, 2015
set bluetooth at command
View hc05.ino
AUTHOR: Hazim Bitar (techbitar)
DATE: Aug 29, 2013
LICENSE: Public domain (use at your own risk)
CONTACT: techbitar at gmail dot com (
View bluetooth_basic.ino
char BYTE;
int LED = 13; // LED on pin 13
void setup() {
pinMode(LED, OUTPUT);
void loop() {
Serial.println("Press 1 to turn Arduino pin 13 LED ON or 0 to turn it OFF:");
anoochit / bluetooth_bacic2.ino
Created Sep 7, 2014
always read data from bluetooth
View bluetooth_bacic2.ino
char BYTE;
void setup() {
void loop() {
while (!Serial.available()); // stay here so long as COM port is empty
BYTE =; // read next available byte