This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
#include<list> | |
int mostFrequent(int arr[], int n) | |
{ | |
// Sort the array | |
sort(arr, arr + n); | |
// find the max frequency using linear traversal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
def main(token): | |
payload = {} | |
headers= { | |
'Authorization': 'Token '+token | |
} | |
url = "https://api.github.com/user" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
######################################################## | |
##### USE THIS FILE IF YOU LAUNCHED UBUNTU ##### | |
######################################################## | |
sudo apt update | |
sudo apt install nginx -y | |
sudo ufw allow 'Nginx HTTP' | |
sudo su | |
sudo systemctl start nginx | |
systemctl status nginx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python -m django startproject video_demo | |
python -m virtualenv env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sandeep.agora; //change this | |
import com.sandeep.agora.media.RtcTokenBuilder; | |
import javax.ws.rs.POST; | |
import javax.ws.rs.Path; | |
import javax.ws.rs.Produces; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.Response; | |
import org.json.simple.JSONObject; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM tomcat:9.0.37 | |
MAINTAINER SaiSandeep | |
COPY target/agoratoken.war /usr/local/tomcat/webapps/ROOT.war | |
EXPOSE 8080 | |
CMD ["catalina.sh", "run"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependencies> | |
<dependency> | |
<groupId>org.glassfish.jersey.containers</groupId> | |
<artifactId>jersey-container-servlet-core</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>org.glassfish.jersey.inject</groupId> | |
<artifactId>jersey-hk2</artifactId> | |
</dependency> | |
<dependency> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<h2>Agora Token Server</h2> | |
<p><a href="webapi/myresource">Agora resource</a> | |
<p>Visit <a href="https://agora.io/">Agora.io website</a> | |
for more information on Agora! | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<servlet-mapping> | |
<servlet-name>Jersey Web Application</servlet-name> | |
<url-pattern>/webapi/*</url-pattern> | |
</servlet-mapping> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> | |
<servlet> | |
<servlet-name>Agora Token Server</servlet-name> | |
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class> | |
<init-param> | |
<param-name>jersey.config.server.provider.packages</param-name> | |
<param-value>com.sandeep.agoratoken</param-value> <!-- Remember to replace this --> | |
</init-param> | |
<load-on-startup>1</load-on-startup> |
OlderNewer