Skip to content

Instantly share code, notes, and snippets.

@manniru
manniru / MainActivity.kt
Created April 10, 2021 18:22 — forked from SheptunovaAA/MainActivity.kt
kotlin example of OKHttp3 WSS
/**
don't forget to add in app gradle:
compile 'com.squareup.retrofit2:retrofit:2.3.0'
and add INTERNET permission to AndroidManifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
...>
<uses-permission android:name="android.permission.INTERNET" />
<application... />
/>
#!/bin/bash
# file: /usr/local/bin/kill_ports
PS3='Please enter your choice: '
options=$(lsof -PiTCP -sTCP:LISTEN | awk '{print $9}' | sed -n '1!p')
RED='\033[0;31m'
NC='\033[0m' # No Color
select port in $options
do
echo "Selected character: $port"
echo "Selected number: $REPLY"
const sendJSON = async () => {
(async () => {
const rawResponse = await fetch("https://httpbin.org/post", {
method: "POST",
headers: {
Accept: "application/json",
"Content-Type": "application/json"
},
body: JSON.stringify({ name: "Mannir", age: 23 })
});
const ref = firestore().collection('people')
.where("gender", "==", this.state.currentUser.genderPreferred)
.where('age', '>=', this.state.currentUser.minimumAgePreferred)
.where('age', '<=', this.state.currentUser.maximumAgePreferred)
.where('longitude', '<=', this.state.currentUser.longitude) // Example here, Haversine function...
// Potentially more conditions...
.orderBy('timeStamp')
.limit(100)
.onSnapshot(querySnapshot => {
let listUsers: User[] = [];
AWSTemplateFormatVersion: '2010-09-09'
Description: CloudFormation template for Flagsmith Platform
Parameters:
ApexDomain:
Description: The domain name for the Flagsmith Platform (e.g., "example.com")
Type: String
Default: example.com
StageName:
Description: The environment for the Flagsmith Platform (e.g., "prod")
239.1.1.1
https://www.red5pro.com/docs/plugins/restreamer/mpeg-ts-ingest-plugin/
@manniru
manniru / hls-js-plugin.markdown
Created November 7, 2021 07:27
hls.js Plugin
@manniru
manniru / index.html
Created November 7, 2021 07:19
m3u8-video-js
<link href="https://cdnjs.cloudflare.com/ajax/libs/video.js/5.10.2/alt/video-js-cdn.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/video.js/5.10.2/video.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/3.0.2/videojs-contrib-hls.js"></script>
<input type="text" id="url" style="width:100%" value="https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8"> <input type="button" id="btn" value="play">
<br><br>
<video id="video" class="video-js vjs-default-skin" preload="none" crossorigin="true" controls width="640" height="268" controls>
</video>
@manniru
manniru / bmicalculator.wsdl
Created October 31, 2021 01:45
NodeJS - SOAP Server and Client
<definitions name="HelloService" targetNamespace="http://www.examples.com/wsdl/HelloService.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://www.examples.com/wsdl/HelloService.wsdl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<message name="getBMIRequest">
<part name="weight" type="xsd:float"/>
<part name="height" type="xsd:float"/>
</message>
@manniru
manniru / curl.md
Created February 27, 2022 11:32 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.