Skip to content

Instantly share code, notes, and snippets.

View xgvargas's full-sized avatar

Gustavo Vargas xgvargas

View GitHub Profile
xgvargas /
Last active April 4, 2023 01:21
List GIT status of all sub directories
#! /usr/bin/bash
if [ -t 1 ]; then
# executed in terminal
xgvargas /
Last active February 27, 2023 23:28
Install KiCAD

If using UBUNTU

As explained here:

sudo add-apt-repository --yes ppa:kicad/kicad-6.0-releases
sudo apt update
sudo apt install --install-recommends kicad
xgvargas /
Last active August 18, 2019 02:56
Kicad configuration




# only include the cache and rescue libs
xgvargas /
Last active July 27, 2019 19:55
Starting with Nativescript and seting up to use Coffeescript, Pug and Stylus


The standard version of Nativescript uses XML, JS and SCSS, no matter the selected framework.

In my case I like to use Pug, Coffeescript and Stylus with VueJS.

Bellow is the process to configure the CLI to use this combination:

# while nativescript uses NPM internally I like to use Yarn, so my global is installed with it.


Kicad project


# only include the cache and rescue libs
xgvargas /
Created April 25, 2019 22:38
WSL installation process


Enable WSL from PowerShell with Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux.

There are multiple way to download/install your distro. I'm lazy, so just go to Windows Store:

Use the GET button to download it. The actual installation will happen on first launch (so it will take some time). During the installation a user name will be requested, it can be anything (ie. do not need to be the same used on Windows).

xgvargas /
Created April 12, 2019 22:06
Method to discover the property with cyclic reference

This is just a copy of this stackoverflow answer.

Simply copy this into browser console and call it with the issued object.

function isCyclic(obj) {
  var keys = [];
  var stack = [];
  var stackSet = new Set();
xgvargas /
Last active August 13, 2019 11:55
Bash script to download subtitles
agent="SubDB/1.0 (autoSubtitle/0.1;"
process_file_f() {
# fpath=${ffull%/*}
xgvargas /
Last active March 13, 2016 02:38
Windows batch file association


Generates two windows .reg file to install and uninstall a collection of associations for your prefered software.

Also, you can configure it to include:

  • create new file (for any file of your collection)
  • Open with... when right click a file
  • Open with... when right click a folder
  • Open with... when right click an empty area inside a opened folder.
xgvargas /
Last active June 25, 2018 09:01
Gulp -> Coffeescript, SCSS, Jade, SVG to PNG, array(SVG) to SVG


You are supposed to have this project layout: