Sergio

Members
  • Content Count

    388
  • Joined

  • Last visited

  • Days Won

    8

Sergio last won the day on April 21

Sergio had the most liked content!

Community Reputation

517 Excellent

1 Follower

About Sergio

  • Rank
    Sr. Member
  • Birthday 04/13/1979

Profile Information

  • Gender
    Male
  • Location
    Belo Horizonte, Brazil

Recent Profile Visitors

6,078 profile views
  1. Thanks! It was as it's a pretty simple extension (source below). I followed the VS Code official docs: https://code.visualstudio.com/docs/extensions/example-hello-world and looked at the examples they gave. // The module 'vscode' contains the VS Code extensibility API // Import the module and reference it with the alias vscode in your code below const vscode = require('vscode'); // this method is called when your extension is activated // your extension is activated the very first time the command is executed function activate(context) { // Use the console to output diagnostic information (console.log) and errors (console.error) // This line of code will only be executed once when your extension is activated console.log('Congratulations, your extension "whichthemeisthat" is now active!'); // The command has been defined in the package.json file // Now provide the implementation of the command with registerCommand // The commandId parameter must match the command field in package.json let disposable = vscode.commands.registerCommand('extension.whichThemeIsThat', function () { // The code you place here will be executed every time your command is executed // context.subscriptions.push(disposable); // create a new status bar item that we can now manage myStatusBarItem = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Right, 100); context.subscriptions.push(myStatusBarItem); myStatusBarItem.show(); updateStatusBarItem(); // register some listener that make sure the status bar // item always up-to-date context.subscriptions.push(vscode.window.onDidChangeActiveTextEditor(updateStatusBarItem)); context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(updateStatusBarItem)); }); } function updateStatusBarItem() { const theme = vscode.workspace.getConfiguration().get('workbench.colorTheme'); const font = vscode.workspace.getConfiguration().get('editor.fontFamily'); myStatusBarItem.text = '$(eye) Theme: ' + theme + ' + ' + 'Font: ' + font; } exports.activate = activate; // this method is called when your extension is deactivated function deactivate() { } exports.deactivate = deactivate;
  2. Which Theme/Font is That? Tired of hearing that question when you share a screenshot or a tutorial on YouTube? Your problems are over! Introducing "Which Theme is That" Visual Studio Code extension. This extension will show on the status bar your workspace's current theme name and font. Install Grab it here: https://marketplace.visualstudio.com/items?itemName=sjardim.whichthemeisthat How to Run Install the extension and run the Command Palette Ctrl+Shift+P or Cmd+Shift+P on Mac. Search for "Which Theme is That?" and hit Enter. Screenshot Enjoy!
  3. Sergio

    Welcome to the forum, @MateThemes ! As @Gideon So already pointed out, to accomplish this you will need to implement a condition on your template code depending on your business needs, but it can also be achieved without any custom code if it's just a matter of hiding a portion of a content from a page that has both languages. If you could explain a little bit more about what you want to accomplish, we can help.
  4. Sergio

    It is! Thanks!
  5. Sergio

    I'm getting a 404 on your website due to Chrome's blocking scripts on http as insecure. See screenshot. Version 70.0.3538.110 (Official Build) (64-bit) on Windows 10
  6. Sergio

    Olá, Guy! I'm hosting the app on Laravel Forge with FastCGI enabled. I've based my config on this @u-nikos post: Here's my version: server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name example.com; root /home/forge/example.com/public; index index.html index.htm index.php; charset utf-8; # ----------------------------------------------------------------------------------------------- # Access Restrictions: Protect ProcessWire system files # ----------------------------------------------------------------------------------------------- # Block access to ProcessWire system files location ~ \.(inc|info|module|sh|sql)$ { deny all; } # Block access to any file or directory that begins with a period location ~ /\. { deny all; } # Block access to protected assets directories location ~ ^/(site|site-[^/]+)/assets/(cache|logs|backups|sessions|config|install|tmp)($|/.*$) { deny all; } # Block acceess to the /site/install/ directory location ~ ^/(site|site-[^/]+)/install($|/.*$) { deny all; } # Block dirs in /site/assets/ dirs that start with a hyphen location ~ ^/(site|site-[^/]+)/assets.*/-.+/.* { deny all; } # Block access to /wire/config.php, /site/config.php, /site/config-dev.php, and /wire/index.config.php location ~ ^/(wire|site|site-[^/]+)/(config|index\.config|config-dev)\.php$ { deny all; } # Block access to any PHP-based files in /templates-admin/ location ~ ^/(wire|site|site-[^/]+)/templates-admin($|/|/.*\.(php|html?|tpl|inc))$ { deny all; } # Block access to any PHP or markup files in /site/templates/ location ~ ^/(site|site-[^/]+)/templates($|/|/.*\.(php|html?|tpl|inc))$ { deny all; } # Block access to any PHP files in /site/assets/ location ~ ^/(site|site-[^/]+)/assets($|/|/.*\.php)$ { deny all; } # Block access to any PHP files in core or core module directories location ~ ^/wire/(core|modules)/.*\.(php|inc|tpl|module)$ { deny all; } # Block access to any PHP files in /site/modules/ location ~ ^/(site|site-[^/]+)/modules/.*\.(php|inc|tpl|module)$ { deny all; } # Block access to any software identifying txt files location ~ ^/(COPYRIGHT|INSTALL|README|htaccess)\.(txt|md)$ { deny all; } # Block all http access to the default/uninstalled site-default directory location ~ ^/site-default/ { deny all; } #Amplify dashboard location /nginx_status { stub_status on; allow 127.0.0.1; deny all; } # ----------------------------------------------------------------------------------------------- # If the request is for a static file, then set expires header and disable logging. # Give control to ProcessWire if the requested file or directory is non-existing. # ----------------------------------------------------------------------------------------------- location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|eot|woff|ttf)$ { expires 15d; log_not_found off; access_log off; try_files $uri $uri/ /index.php?it=$uri&$query_string; } # ----------------------------------------------------------------------------------------------- # ProCache Rules # ----------------------------------------------------------------------------------------------- set $cache_uri $request_uri; if ($request_method = POST) { set $cache_uri 'nocache'; } if ($http_cookie ~* "wires_challenge") { set $cache_uri 'nocache'; } if ($http_cookie ~* "persist") { set $cache_uri 'nocache'; } # ----------------------------------------------------------------------------------------------- # This location processes all other requests. If the request is for a file or directory that # physically exists on the server, then load the file. Else give control to ProcessWire. # ----------------------------------------------------------------------------------------------- location / { expires -1; try_files /site/assets/ProCache-b3d534d...d/$cache_uri/index.html $uri $uri/ /index.php?it=$uri&$args; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } access_log off; error_log /var/log/nginx/example.com-error.log error; error_page 404 /index.php; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; fastcgi_index index.php; include fastcgi_params; } location ~ /\.ht { deny all; } }
  7. Sergio

    Hey @Guy Verville, excellent write-up!! Thank you for that! I've been using ProCache for about 3 years now in Nginx without any issues. So, go ahead! PS: I'd like to suggest you post in on Medium, etc. as well to increase reach. If you decide so, I also suggest to add to Ryans role: creator and maintainer of Processwire... instead of just designer, as people may only read "graphic/web designer" when they see that.
  8. Two examples I've used. //Page "intro" property that can be accessed via $page->intro: wire()->addHookProperty('Page::intro', function($event) { $page = $event->object; if ($page->summary) { //some pages on the admin do not have a summary field, only body $intro = strip_tags($page->summary); } else { $body = strip_tags($page->body); $intro = $body; $length = 450; if (strlen($body) > $length) { $intro = preg_replace("/^(.{1,$length})(\s.*|$)/s", '\\1...', $intro); } } $event->return = $intro; }); // I have a computed page_views field. If the page is a podcast, I added the views from Soundcloud to the page_total_views hook. wire()->addHookProperty('Page::page_total_views', function($event) { $page = $event->object; $views = 0; if ($page->soundcloud_playback !== "") { //if page has a soundcloud field, it's a podcast page $page->of(false); $en = wire('languages')->get("default"); $soundcloud_playback_en = intval($page->getLanguageValue($en, 'soundcloud_playback')); // get the unformatted value in English $pt = wire('languages')->get("pt"); $soundcloud_playback_pt = intval($page->getLanguageValue($pt, 'soundcloud_playback')); // get the unformatted value in Portuguese $views = intval($page->page_views) + $soundcloud_playback_en + $soundcloud_playback_pt; } else { $views = $page->page_views; } $event->return = $views; });
  9. WOW!! This looks awesome, @joshuag!! Seems very useful, especially for speed up the creation of complex templates!!
  10. Sergio

    This is very impressive! Excellent job @bernhard!! Could you detail more about the PDF generation? Library used, how the custom design was made, how you control widows / orphans etc. Thank you!
  11. Sergio

    I use the same as you do on Mac and Win. Laravel Valet on Linux. And I only recommend moving to Docker if you need to work on a team AND need to replicate a server setup in all machines. And if so, I recommend trying Laravel Homestead.
  12. You may find great insights on this thread below, on how to do it by hand. A bit old, but probably everything works even today.
  13. Sergio

    You may need a hook to get it done, take a look on this thread:
  14. Sendy is great if your budget is small AND you need to send emails to a lot of people (10k+). Mailchimp is incredible, but the price for small business is not so good, especially when a dollar is almost 4 times your currency (Brazilian Real) Just keep an eye on your AWS SES reputation dashboard, for complain and bounce rates.
  15. Sergio

    I added the source code on this post: