Skip to content

Instantly share code, notes, and snippets.

var webrtc = require('..');
var RTCPeerConnection = webrtc.RTCPeerConnection;
var RTCSessionDescription = webrtc.RTCSessionDescription;
var RTCIceCandidate = webrtc.RTCIceCandidate;
var pc1 = new RTCPeerConnection();
var pc2 = new RTCPeerConnection();
pc1.onicecandidate = function(candidate) {
@amitv87
amitv87 / StandardFirmataForATH0.ino
Created April 8, 2016 08:56 — forked from edgarsilva/StandardFirmataForATH0.ino
Modified firmata protocol that works on the arduino YUN linux side communicating to the arduino side using the ttyATH0 serialport interface.
/*
* Firmata is a generic protocol for communicating with microcontrollers
* from software on a host computer. It is intended to work with
* any host computer software package.
*
* To download a host software package, please clink on the following link
* to open the download page in your default browser.
*
* http://firmata.org/wiki/Download
*/
@amitv87
amitv87 / qr_pcx_generator.go
Last active November 4, 2017 11:06
QR code in pcx format in pure javascript (using golang libraries with help of gohperjs) for tsc barcode printers
package main
import (
"fmt"
"bytes"
"image"
"github.com/samuel/go-pcx/pcx"
"github.com/skip2/go-qrcode"
"github.com/gopherjs/gopherjs/js"
)
Object.defineProperty(Object.prototype, "watch", {
writable: false,
enumerable: false,
configurable: true,
value: function(prop, handler){
var propVal = this[prop];
Object.defineProperty(this, prop, {
get: () => propVal,
set: (val) => {
handler(this, val, propVal);
/*
"express": "4.14.0",
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.6.0"
# uws backend
curl -v http://localhost:3030
curl -v -d 'hello from curl' -X POST http://localhost:3030
websocat3 ws://localhost:3030/echo
@amitv87
amitv87 / endian.h
Created July 23, 2022 16:11 — forked from yinyin/endian.h
BSD/Linux-like <endian.h> for MacOS X
#ifndef __FINK_ENDIANDEV_PKG_ENDIAN_H__
#define __FINK_ENDIANDEV_PKG_ENDIAN_H__ 1
/** compatibility header for endian.h
* This is a simple compatibility shim to convert
* BSD/Linux endian macros to the Mac OS X equivalents.
* It is public domain.
* */
#ifndef __APPLE__
@amitv87
amitv87 / hexdump.js
Last active October 11, 2022 10:20 — forked from taniarascia/hexdump.js
Hex dump in JavaScript (Node.js)
function hexdump(buffer) {
let lines = []
for (let i = 0; i < buffer.length; i += 16) {
let address = i.toString(16).padStart(8, '0') // address
let block = buffer.slice(i, i + 16) // cut buffer into blocks of 16
let hexArray = []
let asciiArray = []
let padding = ''
@amitv87
amitv87 / cdc.inf
Created December 12, 2022 12:29
cdc.inf
[Version]
Signature="$Windows NT$"
Class=Ports
ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
Provider=%MFGNAME%
DriverVer=12/06/2012,5.1.2600.7
[Manufacturer]
%MFGNAME%=DeviceList,NTamd64