Skip to content

Instantly share code, notes, and snippets.

View shubhamkamthania's full-sized avatar
🖥️
On line

Shubham Kamthania shubhamkamthania

🖥️
On line
View GitHub Profile
<div class="relative max-w-sm rounded overflow-hidden shadow-lg mx-auto my-8">
<div>
<span class="left-0 top-0 text-red-700 absolute">Live</span>
<span class=" right-0 bottom-0 flex w-2/3 absolute">
<div class="w-full md:w-1/2 px-3 mb-6 md:mb-0">
<div class="relative">
<select class="block appearance-none w-full bg-gray-200 border border-gray-200 text-gray-700 py-3 px-4 pr-8 rounded leading-tight focus:outline-none focus:bg-white focus:border-gray-500" id="grid-state">
<option value={0}>Auto</option>
<option value={128}>128 kbit</option>
@shubhamkamthania
shubhamkamthania / streaming.js
Created May 29, 2020 17:38
streaming using janus
var server = "wss://janus.conf.meetecho.com/ws";
var janus = null;
var streaming = null;
var opaqueId = "streamingtest-" + Janus.randomString(12);
var bitrateTimer = null;
var spinner = null;
var simulcastStarted = false,
@shubhamkamthania
shubhamkamthania / youtube_to_embed.js
Created April 21, 2019 05:25
Youtube To Embed userscript. Use with plugins like tampermonkey to automatically redirect to youtube embed for distraction free view.
// ==UserScript==
// @name Youtube Redirect To Embed
// @namespace http://tampermonkey.net/
// @version 0.1
// @description youtube to embed
// @author Shubham Kamthania
// @match https://www.youtube.com/*
// @grant none
// ==/UserScript==
@shubhamkamthania
shubhamkamthania / 01_pkcs12-cacerts-workaround.sh
Created June 8, 2018 06:14 — forked from mikaelhg/01_pkcs12-cacerts-workaround.sh
Workaround for java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
# Ubuntu 18.04 and various Docker images such as openjdk:9-jdk throw exceptions when
# Java applications use SSL and HTTPS, because Java 9 changed a file format, if you
# create that file from scratch, like Debian / Ubuntu do.
#
# Before applying, run your application with the Java command line parameter
# java -Djavax.net.ssl.trustStorePassword=changeit ...
# to verify that this workaround is relevant to your particular issue.
#
# The parameter by itself can be used as a workaround, as well.
@shubhamkamthania
shubhamkamthania / gist:c1326f7c28db28ffcfc0ebf54a7f4f88
Created April 4, 2017 11:02 — forked from jeffsteinmetz/gist:063bd3237033f3af2ed9
Generate Unique, Hashed, Random Token in Scala for use in API calls or as an OAuth Token Bearer
import scala.util._
import java.security.SecureRandom
import java.security.MessageDigest
/*
* Generates a Bearer Token with a length of
* 32 characters (MD5) or 64 characters (SHA-256) according to the
* specification RFC6750 (http://tools.ietf.org/html/rfc6750)
*
* Uniqueness obtained by hashing system time combined with a
// call from web-gateway
// have a controller named MessageController with end point add message
def addMessage = Action.async { implicit rh =>
messageService.addMessage
.handleRequestHeader(ResourceClientSecurity.authenticate())
.invoke(rh.body.asJson.get.as[Message])
.map {
msg => Ok("")
}