This file contains 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
window.onload = function() { | |
navigator.getUserMedia({ | |
video: true, | |
audio: false | |
}, function(localMediaStream) { | |
console.log(localMediaStream) | |
var video = document.querySelector('.camera'); | |
video.srcObject = localMediaStream; | |
video.onloadedmetadata = function(e) { | |
This file contains 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 | |
# Assigning parameters to variables for better readability | |
host="$1" | |
by="$2" | |
for="$3" | |
project="$4" | |
# Getting current timestamp to use it in the session name | |
timestamp=$(date '+%s'); |
This file contains 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
<?php | |
$converter = new Converter('ZZ'); | |
echo $converter->getResult() . PHP_EOL; | |
class Converter | |
{ | |
private $letters; | |
private $result = 0; |
This file contains 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
<input type="number" | |
oninput="javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);" | |
maxlength="6" required/> | |
<script> | |
// do not allow to put "e" symbol | |
$('input[type="number"]').on('keydown', function(e) { | |
let keyCode = e.keyCode || e.which; | |
if( keyCode == 69 ) |
This file contains 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
wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz | |
tar xvf Python-3.6.3.tgz | |
cd Python-3.6.3 | |
./configure --enable-optimizations | |
make -j8 | |
sudo make altinstall | |
python3.6 |
This file contains 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
<?php | |
// App\Exceptions\Handler::render() | |
public function render($request, Exception $exception) | |
{ | |
if ($exception instanceof PostTooLargeException) | |
{ | |
// todo: return response or do whatever you need to do | |
return response()->json(['message' => 'File is too large.'], 422); | |
} |