Skip to content

Instantly share code, notes, and snippets.

View deepakkoirala's full-sized avatar

Deepak Koirala deepakkoirala

View GitHub Profile
@deepakkoirala
deepakkoirala / nato.json
Created October 13, 2023 04:58 — forked from zekesonxx/nato.json
NATO Phonetic Alphabet in JSON. Just in case someone needs it.
{
"A": "Alfa",
"B": "Bravo",
"C": "Charlie",
"D": "Delta",
"E": "Echo",
"F": "Foxtrot",
"G": "Golf",
"H": "Hotel",
"I": "India",
@deepakkoirala
deepakkoirala / HMAC.js
Created September 16, 2023 18:08 — forked from stevendesu/HMAC.js
A simple, open-source, HMAC-SHA256 implementation in pure JavaScript. Designed for efficient minification.
// To ensure cross-browser support even without a proper SubtleCrypto
// impelmentation (or without access to the impelmentation, as is the case with
// Chrome loaded over HTTP instead of HTTPS), this library can create SHA-256
// HMAC signatures using nothing but raw JavaScript
/* eslint-disable no-magic-numbers, id-length, no-param-reassign, new-cap */
// By giving internal functions names that we can mangle, future calls to
// them are reduced to a single byte (minor space savings in minified file)
var uint8Array = Uint8Array;
@deepakkoirala
deepakkoirala / irEmitterApp
Created July 21, 2022 18:34 — forked from francis2110/irEmitterApp
application for send infrared codes to LG tv with arduino
#include <IRremote.h>
IRsend irsend;
#define onOffReceived 10
#define energyRcv 11
#define avMode 12
#define input 13
#define tvRad 14
#define list 15
#define quickView 16
#define volumeUp 17
@deepakkoirala
deepakkoirala / observe.py
Created December 28, 2021 17:33 — forked from tchen/observe.py
Observe Bluetooth advertisements for Govee H5075 and H5177 thermo-gygrometer and print out temperature, humidity, battery level
import datetime
from time import sleep
from bleson import get_provider, Observer
def c2f(val):
return round(32 + 9*val/5, 2)
last = {}
def temp_hum(values, battery, address):
@deepakkoirala
deepakkoirala / upnp.js
Created May 12, 2020 23:37 — forked from acacio/upnp.js
UPNP Port Forwarding for node.js
/* node UPNP port forwarding PoC
This is a simple way to forward ports on NAT routers with UPNP.
This is a not-for-production hack that I found useful when testing apps
on my home network behind ny NAT router.
-satori
usage:
@deepakkoirala
deepakkoirala / Procfile
Created January 18, 2020 22:03 — forked from jordansissel/Procfile
Jenkins on Heroku
# Only listen on http; disable ajp and https
web: java -jar jenkins.war --httpPort=$PORT --ajp13Port=-1 --httpsPort=-1
@deepakkoirala
deepakkoirala / remove-rubber-band-web-apps-ios
Created January 3, 2020 21:47 — forked from amolk/remove-rubber-band-web-apps-ios
Remove rubberband scrolling from web apps on mobile safari (iOS)
<!DOCTYPE html>
<html>
<head>
<title>Remove rubberband scrolling from web apps on mobile safari (iOS)</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta id="extViewportMeta" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<style>
html, body {margin: 0; padding: 0; overflow: hidden}
@deepakkoirala
deepakkoirala / index.html
Created September 11, 2019 21:30 — forked from umidjons/index.html
Upload File using jQuery.ajax() with progress support
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Upload File using jQuery.ajax() with progress support</title>
</head>
<body>
<input type="file" name="file" id="sel-file"/>
@deepakkoirala
deepakkoirala / udp-client-server-nodejs.md
Created September 11, 2019 21:29 — forked from umidjons/udp-client-server-nodejs.md
UDP Client/Server example

UDP Client/Server example

File server.js:

'use strict';

var dgram = require('dgram');
var server = dgram.createSocket('udp4');

const PORT = 3000;
@deepakkoirala
deepakkoirala / extend-eventemitter.md
Created September 11, 2019 21:29 — forked from umidjons/extend-eventemitter.md
Extending EventEmitter example

Extending EventEmitter example

"use strict";

var EventEmitter = require('events').EventEmitter;

class MyClass extends EventEmitter {
    /**
 * Create MyClass instance