Skip to content

Instantly share code, notes, and snippets.

View plkumar's full-sized avatar
:octocat:

Lakshman Kumar Peethani plkumar

:octocat:
View GitHub Profile
@plkumar
plkumar / README.md
Created July 10, 2016 17:23
Install HAP-NodeJS on a Raspberry Pi

Install HAP-NodeJS on a Raspberry Pi

Instructions how to install and build HAP-NodeJS on a Raspberry Pi

Prerequisites

  • Raspberry Pi Model B or newer
  • SD card with latest Raspbian installed and configured with SSH enabled
@plkumar
plkumar / NodeMCU-MQTT-Siri-Wifi-Light.ino
Created July 8, 2016 10:41 — forked from jamesabruce/NodeMCU-MQTT-Siri-Wifi-Light.ino
Wi-Fi Neopixel light controlled over MQTT, to be connected through HAP-NodeJS to Siri
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <PubSubClient.h>
#include <Adafruit_NeoPixel.h>
#define PIN 4
Adafruit_NeoPixel strip = Adafruit_NeoPixel(4, PIN, NEO_GRB + NEO_KHZ800);
@plkumar
plkumar / a-notes.md
Created July 4, 2016 07:13 — forked from creationix/a-notes.md
gikfun esp8266 kit

Amazon has a really good deal on an ESP8266 board in stock with prime. http://www.amazon.com/Gikfun-ESP8266-ESP-12-Industrial-version/dp/B00RK1W7R6

There are no instructions with it so I bought one and between probing with my multimeter and trying different things, I was able to get nodemcu running.

Yellow jumper seems to toggle between flash mode and at mode, closed is flash mode.

three pins labeled gnd, tx, tr are for uart and are what you should plug in. tx-tx,rx-rx,gnd-gnd.

You can leave power dangling

@plkumar
plkumar / README.md
Last active August 29, 2015 14:12 — forked from scttnlsn/README.md

Pub/sub with MongoDB and Node.js

Setup:

$ mongo
> use pubsub
> db.createCollection('messages', { capped: true, size: 100000 })
> db.messages.insert({})
@plkumar
plkumar / Gemfile
Last active August 29, 2015 14:12 — forked from ahaedike/Gemfile
source "https://rubygems.org"
gem 'eventmachine'
gem 'rubysl-stringio'
gem 'sinatra'
gem 'yajl-ruby', require: 'yajl'
gem 'thin'
gem 'em-websocket', :git=>'https://github.com/igrigorik/em-websocket.git'
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
# Based on https://github.com/kripken/emscripten/wiki/Tutorial
# prerequisites
cd ~/
brew install node
sudo ln -s /usr/bin/python2.7 /usr/bin/python2
curl http://llvm.org/releases/3.2/clang+llvm-3.2-x86_64-apple-darwin11.tar.gz > llvm.tgz
tar xzvf llvm.tgz
ln -s clang+llvm-3.2-x86_64-apple-darwin11 llvm
// This hack works with com.android.tools.build:gradle:0.2, won't work in later version without modification
apply plugin: 'android'
targetCompatibility = 1.6
sourceCompatibility = 1.6
android {
target = 'android-14'
<!-- Angular JQM -->
<xsd:attribute name="jqm-caching-view" vs:category="Angular" />
<xsd:attribute name="jqm-footer" vs:category="Angular" />
<xsd:attribute name="jqm-button" vs:category="Angular" />
<xsd:attribute name="jqm-checkbox" vs:category="Angular" />
<xsd:attribute name="jqm-flip" vs:category="Angular" />
<xsd:attribute name="jqm-header" vs:category="Angular" />
<xsd:attribute name="jqm-page" vs:category="Angular" />
<xsd:attribute name="jqm-panel" vs:category="Angular" />
<xsd:attribute name="jqm-panel-container" vs:category="Angular" />
# From Andrzej Szelachowski's ~/.bash_profile:
# Note that a variable may require special treatment
#+ if it will be exported.
DARKGRAY='\e[1;30m'
LIGHTRED='\e[1;31m'
GREEN='\e[32m'
YELLOW='\e[1;33m'