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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Home</title> | |
</head> |
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
const readLine = require('readline'); | |
const fs = require('fs'); | |
const regexWN = new RegExp('Website name:\\s([^\n]+)', ''); | |
const regexWU = /Website URL: ([^\n]+)/; | |
const regexLN = /Login name: ([^\n]+)/; | |
const regexL = /Login: ([^\n]+)/; | |
const regexPW = /^Password: ([^\n]+)/; | |
const regexC = /Comment:/; | |
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 | |
header('Access-Control-Allow-Origin: *'); | |
header('Access-Control-Allow-Methods: POST, GET, DELETE, PUT, PATCH, OPTIONS'); | |
header('Content-type: application/json'); | |
if (isset($_POST['user']) && isset($_POST['password'])) { | |
$jsonArr = ["status" => "true", "POST" => $_POST]; | |
echo json_encode($_POST); | |
} else { |
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
<!DOCTYPE html> | |
<html lang="pt-BR"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Test Front and Back</title> | |
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" | |
integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous"> | |
</head> |
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
// This is an example of how to fetch external data in response to updated props, | |
// If you are using an async mechanism that does not support cancellation (e.g. a Promise). | |
class ExampleComponent extends React.Component { | |
_currentId = null; | |
state = { | |
externalData: null | |
}; |
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 | |
# | |
# Loads / unloads pulseaudio loopback module in order to eg. be redirect | |
# mic input to headphones. | |
# | |
# Usage: mic-loopback [on|off] | |
# | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 [on|off]" |
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
var form = new FormData; | |
var xhr = new XmlHttpRequest; | |
xhr.open('path/to/api', 'POST', true); | |
xhr.onreadystatechange = function(e) { | |
console.log(e); // Check success/fail | |
} | |
var toSendData = { | |
proName: [ | |
'Product 1', |
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
void function() {//closure | |
var global = this | |
, _initKeyboardEvent_type = (function( e ) { | |
try { | |
e.initKeyboardEvent( | |
"keyup" // in DOMString typeArg | |
, false // in boolean canBubbleArg | |
, false // in boolean cancelableArg | |
, global // in views::AbstractView viewArg |
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/sh | |
sudo apt-get update && apt-get upgrade | |
sudo apt-get install php | |
sudo apt-get install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml libapache2-mod-php | |
EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)" | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" |
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
function str_replace_last(search, replace, str){ | |
let pos = str.lastIndexOf('webp'); | |
let search_length; | |
if(pos != -1){ | |
search_length = search.length; | |
str = str.substring(0, pos)+replace+str.substring(pos+search_length); | |
} | |
return str; | |
} |
NewerOlder