Skip to content

Instantly share code, notes, and snippets.

Avatar

Deepak Koirala deepakkoirala

View GitHub Profile
@deepakkoirala
deepakkoirala / irEmitterApp
Created July 21, 2022 18:34 — forked from francis2110/irEmitterApp
application for send infrared codes to LG tv with arduino
View irEmitterApp
#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
View observe.py
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
View upnp.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
View Procfile
# 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)
View remove-rubber-band-web-apps-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
View index.html
<!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
View udp-client-server-nodejs.md

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
View extend-eventemitter.md

Extending EventEmitter example

"use strict";

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

class MyClass extends EventEmitter {
    /**
 * Create MyClass instance
@deepakkoirala
deepakkoirala / gist:7fc74fabee11b5b3c4382312a50db479
Created September 7, 2019 19:59 — forked from corvax19/gist:4275922
Simple text encryption/decryption with openssl
View gist:7fc74fabee11b5b3c4382312a50db479
echo -n "That's the text"|openssl enc -e -aes-256-cbc -a
Encrypt with interactive password. Encrypted message is base64-encoded afterwards.
echo -n "That's the text"|openssl enc -e -aes-256-cbc -a -k "MySuperPassword"
Encrypt with specified password. Encrypted message is base64-encoded afterwards.
echo "GVkYiq1b4M/8ZansBC3Jwx/UtGZzlxJPpygyC"|openssl base64 -d|openssl enc -d -aes-256-cbc
Base-64 decode and decrypt message with interactive password.
echo "GVkYiq1b4M/8ZansBC3Jwx/UtGZzlxJPpygyC"|openssl base64 -d|openssl enc -d -aes-256-cbc -k "MySuperPassword"
@deepakkoirala
deepakkoirala / nodejs-tcp-example.js
Created September 1, 2019 17:52 — forked from tedmiston/nodejs-tcp-example.js
Node.js TCP client and server example
View nodejs-tcp-example.js
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');