Skip to content

Instantly share code, notes, and snippets.

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 Oct 10, 2018
Inspecting changes between commits in git
View changes-between-commits.md

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:

View plex-media-server-ubuntu-howto.md

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

View html-templates.md

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">
 
View cordova.md

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 Jan 28, 2020
AWS - obtain data about own instance
View AWS - obtain data about own instance.md
@luciopaiva
luciopaiva / instance-type.sh
Created Feb 11, 2020
Get AWS own instance type via curl
View instance-type.sh
#!/bin/bash
curl http://169.254.169.254/latest/meta-data/instance-type
View Network perf test with iperf3.md

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

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