Skip to content

Instantly share code, notes, and snippets.

View anupammaiti's full-sized avatar
😎
Before software can be reusable it first has to be usable

Anupam Maiti anupammaiti

😎
Before software can be reusable it first has to be usable
View GitHub Profile
@anupammaiti
anupammaiti / local-stream-server-win10.md
Created October 28, 2023 22:19 — forked from unitycoder/local-stream-server-win10.md
Local RTMP Stream Server for Windows

https://obsproject.com/forum/resources/how-to-set-up-your-own-private-rtmfp-server-using-monaserver.153/ (copied here as a backup)

This article is inspired of the great guide of How to set up your own private RTMP server using nginx. https://obsproject.com/forum/resources/how-to-set-up-your-own-private-rtmp-server-using-nginx.50/

MonaServer is a tiny and scalable open source server which provide protocols RTMFP, RTMP, RTMPE, WebSocket and HTTP. Server applications are written in lua and clients just need to support one of these protocols.

The interest of MonaServer here is the RTFMP broadcast feature that avoid congestion (because it is a UDP protocol) unlike RTMP.

This guide will presents you an easy way to broadcast a video with OBS over RTMFP. Don't worry, you will not need to configure or write any code here :)

@anupammaiti
anupammaiti / aemTouchCheckboxDialog.xml
Created November 24, 2021 21:56 — forked from nateyolles/aemTouchCheckboxDialog.xml
AEM Touch UI component dialog checkboxes
<!-- Checked checkbox will result in a String property of "true" -->
<myCheckbox
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/foundation/form/checkbox"
text="My Checkbox"
name="./myCheckbox"
value="true"/>
<!-- Checked checkbox will result in a Boolean property of true-->
<myBooleanCheckbox
@anupammaiti
anupammaiti / PrintLocalStorage
Created September 9, 2021 19:59
Print All Local Storage Data Crome
function listAllItems(){
for (i=0; i<localStorage.length; i++)
{
key = localStorage.key(i);
console.log(key+":"+localStorage.getItem(key))
}
}
listAllItems();
package com;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
@anupammaiti
anupammaiti / gist:965fc51d5ab79dd9b5a017c29e265adf
Created November 24, 2020 20:37 — forked from jasoet/gist:3843797
Database Connection Singleton
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package org.secondstack.db;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
@anupammaiti
anupammaiti / .content.xml
Created November 18, 2020 22:59 — forked from briankasingli/.content.xml
AEM 6.4 RichText Editor - Enable all features, and disable inline full screen option; the inline fullscreen option causes too many problems.
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="cq:Component"
jcr:title="Rich Text"
sling:resourceSuperType="core/wcm/components/text/v2/text"
componentGroup="General"/>
@anupammaiti
anupammaiti / ResourceToJSONServlet.java
Created June 24, 2020 22:05 — forked from nateyolles/ResourceToJSONServlet.java
Sample servlet which easily prints an AEM/Sling Resource/Node as JSON to the PrintWriter.
package com.nateyolles.aem;
import org.apache.felix.scr.annotations.sling.SlingServlet;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.servlets.SlingSafeMethodsServlet;
import org.apache.sling.commons.json.JSONException;
import org.apache.sling.commons.json.jcr.JsonItemWriter;
@anupammaiti
anupammaiti / pdf_download.js
Created June 14, 2020 14:28 — forked from gpprojekt-marcin/pdf_download.js
jQuery.ajax() download pdf
$.ajax({
url: url,
data: data,
success: function (data) {
var blob = new Blob([data]);
var link = document.createElement('a');
link.href = window.URL.createObjectURL(blob);
link.download = "Dossier.pdf";
link.click();
}
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependency</id>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
@anupammaiti
anupammaiti / bitbucket-pipelines.yml
Created June 5, 2020 20:08 — forked from mcnamee/bitbucket-pipelines.yml
Bitbucket Pipelines - Deploy via FTP to shared hosting
# Installation ---
# 1. In Bitbucket, add $FTP_USERNAME $FTP_PASSWORD and $FTP_HOST as environment variables.
# 2. Commit this file to your repo
# 3. From Bitbucket Cloud > Commits > Commit Number > Run Pipeline > Custom:Init (this will
# push everything and initial GitFTP)
#
# Usage ---
# - On each commit to master branch, it'll push all files to the $FTP_HOST
# - You also have the option to 'init' (from Bitbucket Cloud) - pushes everything and initialises
# - Finally you can also 'deploy-all' (from Bitbucket Cloud) - if multiple deploys fail, you