O guia foi atualizado para este link: https://github.com/codeedu/wsl2-docker-quickstart
import time, traceback | |
def every(delay, task): | |
next_time = time.time() + delay | |
while True: | |
time.sleep(max(0, next_time - time.time())) | |
try: | |
task() | |
except Exception: | |
traceback.print_exc() |
If you have your code defined in classes in lib/ folder you may have problems to load that code in production.
Autoloading is disabled in the production environment by default because of thread safety.
Change config/application.rb:
config.autoload_paths << Rails.root.join("lib")
config.eager_load_paths << Rails.root.join("lib")
// app/Http/Middleware/AssetUrls.js | |
// Middleware to load mix-manifest.json | |
// file Laravel Mix generates | |
class AssetUrls { | |
* handle (request, response, next) { | |
const View = use('View') | |
View.global('assetUrls', function () { | |
return require('../../../public/mix-manifest.json') |
ℹ️ Please note this research is from 2016 when Opera has first added their browser "VPN", even before the "Chinese deal" was closed. They have since introduced some real VPN apps but this below is not about them.
🕵️ Some folks also like to use this article to show a proof that the Opera browser is a spyware or that Opera sells all your data to 3rd parties or something like that. This article here doesn't say anything like that.
When setting up (that's immediately when user enables it in settings) Opera VPN sends few API requests to https://api.surfeasy.com to obtain credentials and proxy IPs, see below, also see The Oprah Proxy.
The browser then talks to a proxy de0.opera-proxy.net
(when VPN location is set to Germany), it's IP address can only be resolved from within Opera when VPN is on, it's 185.108.219.42
(or similar, see below). It's an HTTP/S proxy which requires auth.
// All credits goes to http://stackoverflow.com/users/572129/senthil | |
// http://stackoverflow.com/questions/5711084/java-runtime-getruntime-getting-output-from-executing-a-command-line-program | |
Runtime rt = Runtime.getRuntime(); | |
String[] commands = { "system.exe", "-get t" }; | |
Process proc = rt.exec(commands); | |
BufferedReader stdInput = new BufferedReader(new | |
InputStreamReader(proc.getInputStream())); | |
String s = null; |
alias homestead='function __homestead() { (cd ~/Documents/Code/Homestead && vagrant $*); unset -f __homestead; }; __homestead' | |
# Usage | |
homestead up | |
homestead halt | |
# etc... |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the\
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
Did I hear you wanted AJAX charts instead of hard coded? You got it.
Follow this guide to integrate bar chart reports into your Laravel application with AJAX. Reports like the following come with this guide:
- Total number of Orders by day
- Total number of Users subscribed by day
- etc
The library used for the charts is: http://www.oesmith.co.uk/morris.js/
Follow this guide to integrate bar chart reports into your Laravel application. Reports like the following come with this guide:
- Total number of Orders by day
- Total number of Users subscribed by day
- etc
The library used for the charts is: http://www.oesmith.co.uk/morris.js/
First put this into your page that will have the reports (in the Blade view) to include Morris library: