This file contains hidden or 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
| (rsync -n -art -v --delete-after --force -e ssh integrator:/var/www/vhosts/caionascimento.com.br/httpdocs/catalogo_ifba/ /home/consultjr/merge/ 2>&1) | tee rsync_log.txt |
This file contains hidden or 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
| #In Bash and zsh you can do this with Brace Expansion. This simply expands a list of items in braces. For example: | |
| # echo {vanilla,chocolate,strawberry}-ice-cream | |
| #vanilla-ice-cream chocolate-ice-cream strawberry-ice-cream | |
| #So you can do your rename as follows: | |
| mv {,new.}original.filename | |
| #as this expands to: | |
| #mv original.filename new.original.filename |
This file contains hidden or 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
| select | |
| /* Nomes dos campos ou '*' */ | |
| nome,id | |
| /* Tabela de destino */ | |
| from setor | |
| /* Filtro (opcional) */ | |
| where id = 3; |
This file contains hidden or 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> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>JS Bin</title> | |
| </head> | |
| <body> | |
| </body> | |
| </html> |
This file contains hidden or 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
| @manager.command | |
| def list_routes(): | |
| import urllib | |
| from flask import url_for | |
| output = [] | |
| for rule in app.url_map.iter_rules(): | |
| options = {} | |
| for arg in rule.arguments: |
This file contains hidden or 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
| # Import a module / component using its blueprint handler variable | |
| from blueprints.hello import blueprint as hello | |
| from blueprints.web import blueprint as web | |
| # Register blueprint(s) | |
| app_context.register_blueprint(hello, url_prefix='/hello') | |
| app_context.register_blueprint(web) |
This file contains hidden or 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
| from flask import Blueprint | |
| blueprint = Blueprint('web', __name__, template_folder='templates') | |
| from . import routes |
This file contains hidden or 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
| #HTTP error handling | |
| @app_context.errorhandler(404) | |
| def not_found(error): | |
| return render_template('404.html'), 404 |
This file contains hidden or 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
| curl -0 -v -XPOST http://localhost:3000/posts.json \ | |
| -H "Expect:" \ | |
| -H 'Content-Type: application/json; charset=utf-8' \ | |
| -d @- << EOF | |
| { | |
| "post": { | |
| "author_id": "5482696809", | |
| "author_name": "@endireitabelem", | |
| "body": "Diretas já em cuba .\n#bolsonaro2018 \n#bolsonaropresidente \n#ForaPT \n#ForaComunistas \n@Endireitabelem \nAjude a pagina a crescer, divulgue com seus amigos e familiares vamos juntos Endireitar Belém e o Brasil.", | |
| "document_id": "BVADte9Ako7m567891101234", |
This file contains hidden or 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
| =begin | |
| A binary gap within a positive integer N is any maximal sequence of consecutive zeros | |
| that is surrounded by ones at both ends in the binary representation of N. | |
| Write a function: | |
| def solution(n) | |
| that, given a positive integer N, returns the length of its longest binary gap. | |
| The function should return 0 if N doesn't contain a binary gap. |