Skip to content

Instantly share code, notes, and snippets.

View ntavish's full-sized avatar

Tavish Naruka ntavish

View GitHub Profile
@ntavish
ntavish / nn.py
Created July 15, 2011 18:15
Neural network demo
#!/usr/bin/python
# Back-Propagation Neural Networks
#
# Written in Python. See http://www.python.org/
# Placed in the public domain.
# Neil Schemenauer <[email protected]>
#
# Changes:
# 2009-01-30 Fix dsigmoid() to use correct derivative rather than an
# approximation. Suggested by Andrew Lionel Blais.
@ntavish
ntavish / quicklog.h
Created November 27, 2011 11:15 — forked from anonymous/quicklog.h
Quicklog: For when printf isn't enough but a full logging library is too much
//quicklog.h
//include it, and just loginfo("hello, %s", "world");
//MIT licence
#include <stdio.h>
#include <time.h>
#ifndef QUICKLOG_H
#define QUICKLOG_H
--- complete-dict - Created by Ryan Kulla using Python 2.6 on Ubuntu Linux 9.04 on July 23rd 2009 ---
--- Python Keywords (These were manually inputted) ---
and
del
for
is
raise
assert
elif

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English

@ntavish
ntavish / master.py
Created August 27, 2013 09:49
HC-05 master
#!/usr/bin/python
import serial
a=serial.Serial(port='/dev/ttyUSB0', baudrate=38400, timeout=5)
print "at+role=1"
a.write("at+role=1\r\n")
print a.readline()
#
# this gist can be used to list all targets, or - more correctly - rules,
# that are defined in a Makefile (and possibly other included Makefiles)
# and is inspired by Jack Kelly's reply to a StackOverflow question:
#
# http://stackoverflow.com/questions/3063507/list-goals-targets-in-gnu-make/3632592#3632592
#
# I also found this script - http://www.shelldorado.com/scripts/cmds/targets - which does
# something similar using awk, but it extracts targets from the "static" rules from a single
# Makefile, meaning it ignores any included Makefiles, as well as targets from "dynamic" rules
OSDConf : suggested topics / tracks to choose from:-
Suggest to have voting on the below tracks (add/delete/modify mentioned ones)and only top 4 / 5 concrete to select for the event ..??
Mobile Track
- Android
- HTML5 for Mobile world
- etc.
Web / Browser Track
- HTML5
@ntavish
ntavish / elec-blogs.opml
Created December 1, 2013 14:46
OPML export from rss reader for some electronics related blogs i follow
<opml version="1.0">
<head>
<title>subscriptions in Aol Reader</title>
</head>
<body>
<outline title="Electronics" text="Electronics">
<outline title="Marcin Juszkiewicz" text="Marcin Juszkiewicz" type="rss" xmlUrl="http://feeds.feedburner.com/HrwWebsite" htmlUrl="http://marcin.juszkiewicz.com.pl"></outline>
<outline title="TKJ Electronics" text="TKJ Electronics" type="rss" xmlUrl="http://blog.tkjelectronics.dk/feed/" htmlUrl="http://blog.tkjelectronics.dk"></outline>
<outline title="Embedded projects from around the web" text="Embedded projects from around the web" type="rss" xmlUrl="http://www.embedds.com/feed/" htmlUrl="http://www.embedds.com"></outline>
<outline title="Circuits-Lab.com" text="Circuits-Lab.com" type="rss" xmlUrl="http://www.circuits-lab.com/?feed=rss2" htmlUrl="http://www.circuits-lab.com"></outline>
#!/bin/sh
### BEGIN INIT INFO
# Provides: revssh
# Required-Start: $local_fs $network $named $time $syslog
# Required-Stop: $local_fs $network $named $time $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: reverse ssh tunnel
### END INIT INFO
@ntavish
ntavish / tracer.c
Last active August 29, 2015 14:19 — forked from mniip/tracer.c
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <signal.h>
#include <limits.h>
#include <errno.h>
#include <pthread.h>