$ cargo rustc -- --pretty expanded -Z unstable-options
$ cargo rustc -- --emit asm && cat target/debug/deps/project_name-hash.s
$ cargo rustc -- --emit llvm-ir && cat target/debug/deps/project_name-hash.ll
| # Script is available at https://github.com/supermamon/install-theos | |
| # Or if you trust me run | |
| curl -LO https://git.io/install-theos && bash install-theos |
| def read_lines_from_file_as_data_chunks(file_name, chunk_size, callback, return_whole_chunk=False): | |
| """ | |
| read file line by line regardless of its size | |
| :param file_name: absolute path of file to read | |
| :param chunk_size: size of data to be read at at time | |
| :param callback: callback method, prototype ----> def callback(data, eof, file_name) | |
| :return: | |
| """ | |
| def read_in_chunks(file_obj, chunk_size=5000): |
| #------------------------------------------------------------------------------- | |
| # lexer.py | |
| # | |
| # A generic regex-based Lexer/tokenizer tool. | |
| # See the if __main__ section in the bottom for an example. | |
| # | |
| # Eli Bendersky ([email protected]) | |
| # This code is in the public domain | |
| # Last modified: August 2010 | |
| #------------------------------------------------------------------------------- |
| package main | |
| import( | |
| "log" | |
| "net/url" | |
| "net/http" | |
| "net/http/httputil" | |
| ) | |
| func main() { |
| package main | |
| import( | |
| "log" | |
| "net/url" | |
| "net/http" | |
| "net/http/httputil" | |
| ) | |
| func main() { |
| # Inspired from http://coding4streetcred.com/blog/post/Asymmetric-Encryption-Revisited-(in-PyCrypto) | |
| # PyCrypto docs available at https://www.dlitz.net/software/pycrypto/api/2.6/ | |
| from Crypto import Random | |
| from Crypto.PublicKey import RSA | |
| import base64 | |
| def generate_keys(): | |
| # RSA modulus length must be a multiple of 256 and >= 1024 | |
| modulus_length = 256*4 # use larger value in production |
| { | |
| "config": { | |
| "chainId": 33, | |
| "homesteadBlock": 0, | |
| "eip155Block": 0, | |
| "eip158Block": 0 | |
| }, | |
| "nonce": "0x0000000000000033", | |
| "timestamp": "0x0", | |
| "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", |
| ---------------- Django Nginx + gunicorn ---------------- | |
| Primeiro rode o gunicorn no repositorio do projeto: | |
| $ gunicorn --bind 0.0.0.0:8000 my_academic.wsgi & | |
| Depois crie a seguinte configuração no Nginx (/etc/nginx/sites-available): | |
| server { | |
| access_log /home/user/code_back/logs/access.log; | |
| error_log /home/user/code_back/logs/error.log; |