Posts by Karl Zillner • 873 points
38 posts
-
1
votes1
answer32
viewsQ: How to simulate production in dev while maintaining data secrecy?
When a production error occurs, the programmer needs to simulate the error to correct it. But I don’t want the developer to have access to all production data. The solution I thought was to have a…
djangoasked Karl Zillner 873 -
0
votes2
answers2605
viewsA: How to insert an HTML file with [innerHtml] and maintain Angular attributes
Very simple, use the $compile: Put him in your app.controller: app.controller('MainController', function($scope, $http, $rootScope, $compile) { ... Do the APPEND of HTML like this: var elementoHTML…
-
1
votes1
answer47
viewsA: How to proceed when having to apply an emergency Hotfix?
Use the command git stash It serves exactly to save what you were doing, allowing you to do a Hotfix and then you resume typing: git stash apply You can even create more than one stash and can check…
gitanswered Karl Zillner 873 -
1
votes1
answer74
viewsA: Gulp-rev-all replacing the dom-module id
I saw a solution with replace as well and I found it bad exactly because of these conflicts it can give. I solved this using the Gulp-hash so that he puts the hash in the file name and generates a…
-
0
votes2
answers180
viewsA: Problem with importing files into different directories
For those who also have this question, it’s good to know that you did right in putting the files __init__.py in folders. Without this it would not work. For your specific case, in the file…
-
4
votes1
answer360
viewsA: Server DDOS attack
The solution also depends on your version of Apache and Linux, I will put the solution with the mod_evasive of Apache2. First install the mod_evasive sudo apt-get -y install libapache2-mod-evasive…
-
1
votes3
answers260
viewsA: Block link in . php
It is important to check the file mimetype, because there is a type of attack in which vc sends a php file with jpg extension and manages to run it on the server. That’s why IT’S NOT ENOUGH check…
phpanswered Karl Zillner 873 -
1
votes1
answer135
viewsA: how to take the value of each input and play each one in a variable
Try this way: $variavel = '<html> <body> <input name="nome" id="nome" value="carlos" type="hidden"> <input name="sobrenome" id="sobrenome" value="silva" type="hidden">…
phpanswered Karl Zillner 873 -
0
votes2
answers49
viewsA: Remove tags from a php varchar variable
For this you will need the classes Domdocument and Domxpath: <?php $variavel = ' <table> <tr class="header"> <td class="check"></td> <td class="campo_grid_1…
phpanswered Karl Zillner 873 -
0
votes1
answer867
viewsA: How to convert a saved string into a . txt file, to an integer number?
In this way: with open('data.txt', 'r') as file: data=int(float( file.read().replace('\n', '') )) When you use the open with with it will already close the file. So I used this way.…
-
1
votes5
answers3553
viewsA: Only get a part of a url
Javascript has by default this information in window.location and to get the value more easily you can use the URL class. var url = new URL(window.location); var ip = url.searchParams.get("ip"); The…
javascriptanswered Karl Zillner 873 -
1
votes1
answer130
viewsA: Problems with Sockets
There are several ways to do this and ready libs. I’ll put here an example js native. function WebSocketTest() { if ("WebSocket" in window) { alert("WebSocket is supported by your Browser!"); // Let…
-
5
votes1
answer205
viewsA: Rounded edge on Google Chrome iOS buttons
Chrome has released a change to the default CSS of the browser itself. From the version that was updated this month Version 62.0.3202.94 (Official version) 64 bits The attribute border-Radius comes…
-
1
votes1
answer1312
viewsA: Read using data from an external json file without jQuery
To work the global variable with AJAX you must make a request with. Just change this line: httpRequest.open('GET', path, false); Otherwise it does not work, because when printing the variable on the…
-
0
votes1
answer595
viewsA: Load Json file with Ajax
Put the Ids with quotes and tag input you should put .value and not .innerHTML <div class="container"> <form class="col s12"> <div class="row"> <div class="input-field col s5…
-
2
votes1
answer222
viewsA: Deploy Account Debit on my website
You can use a payment gateway such as: Paying Cielo Moip Pay me. EBANX Paypal Paying attention to rates and conditions that vary. My recommendation is that you do it directly with the bank’s API. In…
phpanswered Karl Zillner 873 -
3
votes2
answers134
viewsA: How to know which variables are defined?
According to the Stack in English would be as follows: dir() returns a list of variables in the scope globals() returns a dictionary of global variables locals() returns a dictionary of local…
-
3
votes1
answer139
viewsA: Apply 2 Google Analytics tracking Ids
According to himself google support you can use normally, only nay should repeat the file instance ga js., this can cause conflicts. You can also name each ID and use it this way: <script>…
javascriptanswered Karl Zillner 873 -
1
votes1
answer363
viewsA: Log in and see if page is online with Curl
The function curl_exec returns the HTML of the request, and you can also get http code with the function curl_getinfo. $document = curl_exec($ch); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);…
-
0
votes1
answer801
viewsA: How to take select(MYSQL) data and display in different fields?
I recommend connecting to Mysql using the PDO class, as an example below: <?php $server = "localhost"; $database = "test"; $user = "usuario"; $pass = "senha"; try { $dbh = new PDO('mysql:host='.…
-
1
votes0
answers34
viewsQ: Logging request.META does not work with Django Channels + Asgi_redis
I have a custom class for logging and my Settings this way: base py. LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'verbose': { 'format':…
-
1
votes3
answers332
viewsA: Receive Jquery and PHP response from second to second
I believe that for the purpose you want, a Websocket is much better than ajax requests of 1 in 1 second. With websocket Voce would see in real time. You would make your own script that is running…
-
2
votes2
answers103
viewsA: Django collectstatic does not update modified files on S3
I created a Settings file to run collectstatic locally to synchronize with S3. In this file I set: TIME_ZONE = 'UTC' Worked perfectly. I’m using S3 in São Paulo, theoretically the S3 Timezone is the…
-
1
votes2
answers103
viewsQ: Django collectstatic does not update modified files on S3
I’m using Django 1.10.6, follow this tutorial to configure media and staticfiles in S3 and when I spin collectstatic, files are not updated.…
-
5
votes1
answer216
viewsQ: Amazon Elastic Beanstalk + Django + Sentry returning Raven.exceptions.Invalidgitrepository
I’m trying to deploy to AWS Elastic Beanstalk. My project has a structure where Django’s Settings is in the Settings folder: |projeto |--settings |----settings.py It contains the configuration as:…
-
1
votes1
answer72
viewsA: Doubt in a Javascript onclick event
Just change your function, you are removing two Divs above the button that would be the div that contains everything. See: function adicionar() { var itm =…
-
2
votes2
answers1933
viewsA: Send email in HTML format with background image and text on top of image
First thing you need to know to create email marketing is that the patterns are the oldest of HTML, from the time when CSS was not used to format things. So to make a text with background image you…
-
2
votes2
answers1906
viewsA: Swap Image and clear cache
It doesn’t need PHP or AJAX requests. I did it in a very simple project. Just putting querystring in the image itself. No need to create php file. Just put a timestamp in the image src. <!DOCTYPE…
javascriptanswered Karl Zillner 873 -
1
votes1
answer168
viewsA: Close Form Dynamically jQuery
I wouldn’t use [ ] in an id, use cloonedForm1, ids may have some incompatibilities in the way of writing. Depending on the browser and the DOM version. In this case the incompatibility is pq jQuery…
-
0
votes1
answer421
viewsA: file_get_contents generating 500 error
file_get_contents is a function that depending on how you use may represent a security breach, so the use of it is activated by php.ini If you use it without enabling it in php.ini it will return…
phpanswered Karl Zillner 873 -
2
votes2
answers736
viewsA: Django/Ckeditor Error build_attrs() got an Unexpected keyword argument 'name' Request
I managed to solve by downgrade Django from 1.11 to 1.10.6 I upgraded too early for the latest version of Django.
-
1
votes2
answers736
viewsQ: Django/Ckeditor Error build_attrs() got an Unexpected keyword argument 'name' Request
build_attrs() got an Unexpected keyword argument 'name' Request Method: GET Request URL: http://localhost:8888/admin/videos/videos/1/change/ Django Version: 1.11 Exception Type: Typeerror Exception…
-
0
votes0
answers229
viewsQ: Email attachment file with file upload in Django
I need to send a request.FILES file from a File field as an attachment in the email. I’m following topics that teach this, but it’s not working. Django from my project is 1.5 I’m doing it this way:…
djangoasked Karl Zillner 873 -
2
votes1
answer245
viewsA: max_input_vars has a value limit?
The max_input_vars is relative to the quantity of variables. Maybe your problem is with the size (in bytes) of the content sent. There are other configs related to this, such as post_max_size If the…
phpanswered Karl Zillner 873 -
0
votes1
answer54
viewsQ: What if I don’t want any queryset in a Django view?
There are urls that I only need to set a Session or query a restful....enfim. API What if I don’t want a queryset? Because Django seems to force me to define a? Would have some kind of different…
-
1
votes1
answer120
viewsA: Create a log system
You can do this by extending the PHP Exception class Example of use: <?php class customException extends Exception { public function errorMessage() { //error message $errorMsg = 'Erro na linha…
phpanswered Karl Zillner 873 -
2
votes1
answer63
viewsA: CSV file saved in the database
You can create the CREATE STATEMENT like this: #!/bin/sh # pass in the file name as an argument: ./mktable filename.csv echo "create table $1 ( " head -1 $1 | sed -e 's/,/ varchar(255),\n/g' echo "…
-
3
votes2
answers643
viewsA: AJAX request with form is updating the page
Clicking the Submit button is an event of the browser itself, it must be undone to use an ajax. There are different ways to do this. e. preventDefault() - works in most cases, but does not prevent…