Skip to content

Instantly share code, notes, and snippets.

gzagatti /
Created Mar 4, 2016
Creating a github repo from the command line and setting up https protocol
  • create a repo via the command line: hub create
  • it's possible to connect with github via a number of protocols, like ssh and https. In order to have https as the default: git config --global hub.protocol https
  • in order to push to a given repo once 2FA is activated via https, it's necessary to generate an access token and use that as the password instead of the login password for the user
gzagatti /
Created Mar 5, 2016
List devices in the network

In order to find devices connected to the same network use: arp -a -n

gzagatti /
Created Mar 14, 2016
Available commands in node.js REPL

Node.js REPL

Special REPL commands:

  • .break/<ctrl>C: breaks multi-line expressions
  • .clear: resets the context
  • .exit/<ctrl>D: close the I/O stream; causes the REPL to exit
  • .help: show this list of special commands
  • .save: save the current REPL session
  • .load: load a file int the current REPL session
  • tab: show both global and local scope variables
gzagatti /
Last active Mar 17, 2016
Apache VHosts and Dnsmasq set up

Local Development with Apache VHosts and Dnsmasq

  1. setting up apache
    • when setting up the VHosts, it's necessary to comment out the example config otherwise we get warnings that a given folder was not found
  2. setting up Dnsmasq

Apache tools

  • apachectl start / apachectl stop / apachectl restart: turn on/off apache server
  • apachectl configtest: test apache configuration
gzagatti / increase_match.vim
Created Mar 20, 2016
Increase digit by 1 in vim match
View increase_match.vim
gzagatti / matplotlibrc
Created May 2, 2016 — forked from huyng/matplotlibrc
my default matplotlib settings
View matplotlibrc
# This is a sample matplotlib configuration file - you can find a copy
# of it on your system in
# site-packages/matplotlib/mpl-data/matplotlibrc. If you edit it
# there, please note that it will be overridden in your next install.
# If you want to keep a permanent local copy that will not be
# over-written, place it in HOME/.matplotlib/matplotlibrc (unix/linux
# like systems) and C:\Documents and Settings\yourname\.matplotlib
# (win32 systems).
gzagatti /
Last active May 23, 2016
Solve ft_render error in octave, by installing fontconfig with universal support. Gnuplot makes use of fontconfig to display fonts.

In order to install octave with support for free type fonts when plotting it is necessary to install fontconfig with universal access, which builds a universal binary. Otherwise the following error is returned:

warning: ft_render: unable to load appropriate font
warning: could not match any font: *-normal-normal-10

Gnuplot makes use of fontconfig to display fonts. So first install fontconfig: brew install fontconfig --universal. Then install gnuplots: brew install gnuplots --with-qt, the flag --with-qt refers to the gui interface which you're willing to use

gzagatti / vnew_full_length.vim
Created Jun 24, 2016
Open a new file splitting the window vertical and occupying the full height of the window
gzagatti /
Created Jun 27, 2016
Kill process using port 3000
lsof -t -i :3000 | xargs kill -9
gzagatti /
Created Jun 29, 2016
Start an ipython console with linked with an existing notebook

When you start the ipython notebook in the terminal, it will output something like this:

2015-03-26 13:05:52.772 [NotebookApp] Kernel started: 4604c4c3-523b-4373-bfdd-222eb1260156 Then start the ipython console like this:

ipython console --existing 4604c4c3