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
@luciopaiva
luciopaiva / changes-between-commits.md
Created October 10, 2018 16:14
Inspecting changes between commits in git

List files touched:

git diff --stat commit-1 commit-2

List change counts:

git diff --shortstat commit-1 commit-2 | cat

List authors between two commits:

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 {} ;

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">

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
@luciopaiva
luciopaiva / AWS - obtain data about own instance.md
Created January 28, 2020 20:24
AWS - obtain data about own instance
@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 / 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

// @include my-script.js
// @include "some other script.js"
/* @include third-script.js */
setup(); // `setup` is defined in `my-script.js`
.foo {}
/* @include other.css */
.bar {}
console.info("HULLO");