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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Test socket</title> | |
</head> | |
<body> | |
<form> |
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
/********************************* | |
* Server side of implementation | |
**********************************/ | |
var app = require('express')(); | |
var http = require('http').createServer(app); | |
var io = require('socket.io')(http); | |
app.get("/", (req, res) => { | |
res.render("client.ejs"); |
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 django.shortcuts import render | |
from django.views.generic import FormView | |
from .forms import AuthForm | |
from django.contrib.auth.decorators import login_required | |
from django.contrib import messages | |
from django.urls.base import reverse_lazy | |
from django.shortcuts import redirect | |
class AuthView(FormView): |
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
{% extends 'custom_auth/base.html' %} | |
{% block title %} Authentication page {% endblock %} | |
{% block content %} | |
<form method="post" action="{% url 'custom_auth:auth_view' %}"> | |
{% csrf_token %} | |
{{ form.as_p }} | |
<input type="submit" value="valider" /> | |
</form> | |
{% endblock %} |
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 numpy as np | |
import imutils | |
try: | |
import cv2 | |
except ImportError: | |
from cv2 import cv2 | |
def order_points(pts): |
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 librtmp | |
import time | |
import re | |
class ParamsError(Exception): | |
"""Raised while download params are incorrect.""" | |
pass | |
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
const { xml } = require('@xmpp/client'); | |
function simpleMessage(to, from, type, message){ | |
return xml( | |
"message", | |
{to, from, type}, | |
xml("body", {},message) | |
) | |
} |
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
const assert = require('chai').assert; | |
const socket = require('socket.io-client')("http://localhost:3000"); | |
/** | |
* function used to wait response on a channel | |
* | |
* @param {String} channel | |
* @param {Function} callback | |
*/ |
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
function isCorrect(expr){ | |
const n = expr.length; | |
const numbers = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"]; | |
const beforeOperator = [...numbers, ")"] | |
const afterOperator = [...numbers, "("] | |
const operators = ["+", "-", "/", "*", "."]; | |
const authorisedsChars = [...numbers, ...operators, "(", ")"]; | |
let leftParenthesis = []; | |
for(let i = 0; i < n; i++){ |
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
""" | |
Small script for converting all mp4 files inside a folder to mp3 into an output folder | |
Requirement : ffmpeg, python30 | |
Usage : python mp4_to_mp3.py -d <input_directory> -o <ouput_directory> | |
Author: Gtindo.dev | |
Licence: ISC | |
""" | |
import subprocess |