Dump existing data:
python3 manage.py dumpdata > datadump.json
Change settings.py to Postgres backend.
Make sure you can connect on PostgreSQL. Then:
| # To connect this middleware.rb file to your sinatra app | |
| # add 'use JWTAuthorization' as one of your first lines in | |
| # your Application class. | |
| # e.g. | |
| # require 'middlewares.rb' | |
| # class Application < Sinatra::Base | |
| # use JWTAuthorization | |
| # ... | |
| # end |
| /* | |
| Template literals for-loop example | |
| Using `Array(5).join(0).split(0)`, we create an empty array | |
| with 5 items which we can iterate through using `.map()` | |
| */ | |
| var element = document.createElement('div') | |
| element.innerHTML = ` | |
| <h1>This element is looping</h1> | |
| ${Array(5).join(0).split(0).map((item, i) => ` |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
| Mutt | |
| http://www.mutt.org/doc/manual/manual.html | |
| Select (tag) messages: shift+t (T) | |
| = (string) | |
| ~ (expression) | |
| ~b expr (message with expr in body) | |
| [b]body |
As seen here: http://blog.z3bra.org/2014/01/images-in-terminal.html
Install packages w3m and some terminal emulator which supports images (urxvt, terminator, termite).
Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.
You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.
| /** | |
| * @param $str the string to check | |
| * @return bool whether the String $str is a valid ip or not | |
| */ | |
| function isValidIP($str) | |
| { | |
| /** | |
| * Alternative solution using filter_var | |
| * | |
| * return (bool)filter_var($str, FILTER_VALIDATE_IP); |
| <?php | |
| /** | |
| * Comprueba si el rut ingresado es valido | |
| * @param string $rut RUT | |
| * @return boolean | |
| */ | |
| public function valida_rut($rut) | |
| { | |
| if (!preg_match("/^[0-9.]+[-]?+[0-9kK]{1}/", $rut)) { |
| <!doctype> | |
| <html> | |
| <head> | |
| </head> | |
| <body> | |
| <?php | |
| require_once "Classes/PHPExcel.php"; | |
| $tmpfname = "test.xlsx"; |