Skip to content

Instantly share code, notes, and snippets.

View luciopaiva's full-sized avatar
🐌
I may be slow to respond

Lucio Paiva luciopaiva

🐌
I may be slow to respond
View GitHub Profile
console.info("HULLO");
.foo {}
/* @include other.css */
.bar {}
@luciopaiva
luciopaiva / Network perf test with iperf3.md
Created February 17, 2020 19:33
Network perf test with iperf3

Network perf test with iperf3

iperf: https://github.com/esnet/iperf

Installation

In case sudo yum install iperf3 doesn't work:

git clone https://github.com/esnet/iperf.git

cd iperf

@luciopaiva
luciopaiva / instance-type.sh
Created February 11, 2020 15:53
Get AWS own instance type via curl
#!/bin/bash
curl http://169.254.169.254/latest/meta-data/instance-type
@luciopaiva
luciopaiva / AWS - obtain data about own instance.md
Created January 28, 2020 20:24
AWS - obtain data about own instance

CORS issues when running via Webstorm

Jetbrains had a Chrome extension where you could configure Webstorm to include CORS headers just fine, but it seems to not be working anymore (setting the field and hitting the apply button has no effect - reloading the extension configuration page shows that the field is still empty).

This comment was what helped me, but it was not enough. I reply to that comment with the extra instructions needed. Here's the full conversation in case that page goes down:


Ekaterina Prigara says:

Things I learned while playing with Cordova

  • use Webstorm to develop your app
  • deploy via Webstorm (it has a Cordova configuration template)
  • try your app in Chrome by clicking the Chrome button in Webstorm
  • configure JetBrains IDE plugin in Chrome to allow for cross-origin requests
  • your Android app will complain about cross-origin requests as well
  • you can debug your deployed Android app via Chrome through chrome://inspect
  • if you're previewing your page in Chrome, you may need to disable web security in order to use fetch() pointing to other domains. See this

Using HTML templates in Javascript

This is the proper way to have HTML templates and clone them in Javascript.

First add the template to your HTML:

<template id="example-template">
    <div class="example">

Plex Media Server on Ubuntu

Install it by following the instructions on the web site.

Troubleshooting Plex not seeing media files

Make sure your directories and files have the right permissions:

find . -type f -exec chmod 644 {} ; find . -type d -exec chmod 755 {} ;

// @include my-script.js
// @include "some other script.js"
/* @include third-script.js */
setup(); // `setup` is defined in `my-script.js`