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
# get message in terminal | |
message = input("Enter with your message: ") | |
# dictionare is the list of symbols and codes, and the meaning of them | |
dictionare = { | |
"G1": { | |
"!": "a", | |
"@": "b", | |
"#": "c" | |
}, | |
"G2": { |
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
// code to consult the google api to return the best route to two points | |
$origin = urlencode($req->origin); | |
$destination = urlencode($req->destination); | |
$ch = curl_init("https://maps.googleapis.com/maps/api/directions/json?optimize=true&mode=walking&origin=$origin&destination=$destination&key=AIzaSyCB_KsYe9Iy2stJHASf7QQ1BnzPQRlKdI0"); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
$data = json_decode(curl_exec($ch)); | |
$json = json_encode([ |
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
[Tue Oct 09 01:56:28.975199 2018] [wsgi:error] [pid 25746] [remote 191.6.113.63:52101] mod_wsgi (pid=25746): Target WSGI script '/var/www/sentinela_site/sentinela/wsgi.py' cannot be loaded as Python module. | |
[Tue Oct 09 01:56:28.975351 2018] [wsgi:error] [pid 25746] [remote 191.6.113.63:52101] mod_wsgi (pid=25746): Exception occurred processing WSGI script '/var/www/sentinela_site/sentinela/wsgi.py'. | |
[Tue Oct 09 01:56:28.975574 2018] [wsgi:error] [pid 25746] [remote 191.6.113.63:52101] Traceback (most recent call last): | |
[Tue Oct 09 01:56:28.975636 2018] [wsgi:error] [pid 25746] [remote 191.6.113.63:52101] File "/var/www/sentinela_site/sentinela/wsgi.py", line 15, in <module> | |
[Tue Oct 09 01:56:28.975649 2018] [wsgi:error] [pid 25746] [remote 191.6.113.63:52101] application = get_wsgi_application() | |
[Tue Oct 09 01:56:28.975664 2018] [wsgi:error] [pid 25746] [remote 191.6.113.63:52101] File "/var/www/sentinela_site/env/lib/python3.5/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application | |
[Tue |
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
Traceback (most recent call last): | |
File "manage.py", line 15, in <module> | |
execute_from_command_line(sys.argv) | |
File "/var/www/sentinela_site/env/lib/python3.5/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line | |
utility.execute() | |
File "/var/www/sentinela_site/env/lib/python3.5/site-packages/django/core/management/__init__.py", line 375, in execute | |
self.fetch_command(subcommand).run_from_argv(self.argv) | |
File "/var/www/sentinela_site/env/lib/python3.5/site-packages/django/core/management/base.py", line 316, in run_from_argv | |
self.execute(*args, **cmd_options) | |
File "/var/www/sentinela_site/env/lib/python3.5/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 59, in execute |
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
# Python Version: Python3 | |
# Django Version: 2.1 | |
# Server version: Apache/2.4.18 (Ubuntu) | |
# My requirements.txt | |
diff-match-patch==20121119 | |
Django==2.1.1 | |
django-ajax-selects==1.7.1 | |
django-crispy-forms==1.7.2 | |
django-filter==2.0.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
class MyAdminSite(AdminSite, ModelAdmin): | |
def index(self, request, extra_context=None): | |
""" | |
Display the main admin index page, which lists all of the installed | |
apps that have been registered in this site. | |
""" | |
app_list = self.get_app_list(request) | |
client_count = Client.objects.count() | |
device_count = Device.objects.count() | |
identification_count = Identifications.objects.count() |
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
<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:v1='http://v1.service.ws.activiafs.activia.com.br/'> | |
<soapenv:Header/> | |
<soapenv:Body> | |
<v1:buscarDisponibilidade> | |
<buscarDisponibilidadeIn> | |
<endereco> | |
<codigoEndereco>68900-095</codigoEndereco> | |
<codigoCliente>pacSTN127103</codigoCliente> | |
<logradouro>Av. Ataíde Teive, 1233 - Central, Macapá - AP, 68900-095, Brazil</logradouro> | |
<cep>68900-095</cep> |
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
{ | |
"data": [ | |
{ | |
"points": [ | |
0.0430421, | |
-51.0679453 | |
], | |
"distancia": { | |
"text": "0.1 km", | |
"value": 106 |
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 | |
namespace App\Http\Controllers; | |
use function GuzzleHttp\Psr7\str; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\DB; | |
class cobrancaController extends Controller | |
{ | |
private function getDD($codcli) |
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
public function index() { | |
$this->validate($request, [ | |
"equipmentType" => 'bail|required|in:pac,cto,roteamento,ponto|string', | |
"equipmentId" => [ | |
"required", | |
Rule::exists($request->get('equipmentType')->where(function ($query) use ($request) { | |
$equipmentType = $request->get('equipmentType'); | |
if($equipmentType === 'pac') { | |
$column = 'cdpac' | |
} else if ($equipmentType === 'cto') { |
OlderNewer