Skip to content

Instantly share code, notes, and snippets.

View notthetup's full-sized avatar
🔊

Chinmay Pendharkar notthetup

🔊
View GitHub Profile
@notthetup
notthetup / mqtt.py
Created January 16, 2016 10:55
mqtt with piglow on RPi
import mosquitto as mqtt
from piglow import PiGlow
piglow = PiGlow()
# The callback for when the client receives a CONNACK response from the server.
def on_connect(client, userdata, rc):
print("Connected with result code "+str(rc))
# Subscribing in on_connect() means that if we lose the connection and
Name: node-four
Cartridge-Short-Name: NODE4
Display-Name: node v4
Description: "Node.js v4 cartridge"
Version: '1.0.0'
Source-Url: https://github.com/notthetup/openshift-node4.git
License: "Apache v2"
License-Url: https://github.com/connyay/openshift-node4/blob/master/LICENSE
Cartridge-Version: 0.1
Compatible-Versions: ['0.1']
@notthetup
notthetup / websecurity.md
Last active December 1, 2015 23:42
Web Security And Crypto Topics

Web + Security + Crypto

Protocols

  • IP
  • TCP/UDP
  • HTTP
  • SSL/TSL
  • HTTP2
  • WebSockets
_renderWaveform: function(buffer){
var samples = buffer.getChannelData(0);
var container = this.$$('paper-item-body');
var canvas = this.$$('#waveform');
var width = container.offsetWidth;
var height = Math.min(container.offsetHeight, 76);
var ratio = this._getBackingScale(canvas);
canvas.width = Math.floor(width * ratio);
@notthetup
notthetup / playwithfire.md
Last active December 15, 2015 21:28
Running Play Store on Amazon Fire

Instructions for running Google Play on Amazon Fire.

These instructions are tested on a Fire running Fire OS 5.0.1 : Android 5.1

Setup adb (android debugger)

  1. Download and Install the Android SDK from http://developer.android.com/sdk/index.html#Other

Enable debugging of the device

  1. In your Fire, open Setting -> "Device Options". Tap on "Serial Number" 7 times to enable Developer Mode.
  2. Inside "Developer Options", check "Enable ADB". (Sometimes the UI is finicky, so you might have to disable and re-enable this to be able to see the device from abd.
[{
"name": "AES Journal Podcast",
"feedURL": "http://www.aes.org/rss/podcasts.cfm/1",
"podcastURL": "http://www.aes.org/podcasts/"
},
{
"name": "Android Developers Backstage",
"feedURL": "http://feeds.feedburner.com/blogspot/AndroidDevelopersBackstage",
"podcastURL": "http://androidbackstage.blogspot.com/"
@notthetup
notthetup / loadmanager.js
Created April 6, 2015 08:17
Load Manager
var toLoad = 0;
function loadManager(callback){
toLoad++;
var onload = function(){
toLoad--;
if (typeof callback === 'function'){
callback();
}
if (toLoad === 0){
@notthetup
notthetup / scopeNode
Created April 5, 2015 06:19
ScopeNode
var scopeNode = context.createScriptProcessor();
scopeNode.onaudioprocess= function (ev){
var ch1Data = ev.inputBuffer.getChannelData(0);
var max = -2;
for(i=0; i<1024; i++){
if (ch1Data[i] > max){
max = ch1Data[i];
}
}
console.log(max);
@notthetup
notthetup / deamons.rc
Created March 31, 2015 04:24
Deamon control aliases
alias conjure="systemctl enable"
alias summon="systemctl start"
alias slay="systemctl stop"
alias banish="systemctl disable"