Skip to content

Instantly share code, notes, and snippets.

View jonathanmorgan's full-sized avatar

Jonathan Morgan jonathanmorgan

View GitHub Profile
@jonathanmorgan
jonathanmorgan / README.MD
Created July 1, 2016 12:48 — forked from aanastasiou/README.MD
Generate a Cypher query to store a Python Networkx directed graph

Exporting a Networkx graph as a Cypher query

This little project defines a function that can be used to construct a Cypher query which when executed against a Neo4j database server will store the graph to the server.

Background

  • A Graph is an abstract mathematical model composed of Nodes connected through Edges that can be used to describe complex systems composed of a set of parts (corresponding to nodes) and their connections (corresponding to edges).
  • Examples of graphs are road networks (junctions connected via roads), electronic circuit networks (components and their connections) and others
  • Networkx is an excellent Python module for manipulating such Graph objects of any kind.
  • Neo4j is a graph database. It uses the Graph as a data model to store such objects to a data store.
@jonathanmorgan
jonathanmorgan / git-multi-status.sh
Last active April 12, 2022 15:06 — forked from c0wfunk/git-multi-status.sh
Script for checking git status of many git repositories
#!/bin/bash
# usage: $0 source_dir [source_dir] ...
# where source_dir args are directories containing git repositories
red="\033[00;31m"
green="\033[00;32m"
yellow="\033[00;33m"
blue="\033[00;34m"
purple="\033[00;35m"
@jonathanmorgan
jonathanmorgan / fix-wsl2-dns-resolution
Created December 23, 2021 01:59 — forked from coltenkrauter/fix-wsl2-dns-resolution
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@jonathanmorgan
jonathanmorgan / tools-ipython_jupyter.ipynb
Last active November 20, 2020 11:37
Big Data Basics - tools - IPython and Jupyter
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonathanmorgan
jonathanmorgan / intro_to_python.ipynb
Last active February 2, 2019 21:44
Big Data Basics - Intro to Python 2
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonathanmorgan
jonathanmorgan / Good_programming_habits.ipynb
Last active March 24, 2017 16:50
Good programming habits
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonathanmorgan
jonathanmorgan / directory_help.ipynb
Last active January 12, 2017 11:31
Directory help.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonathanmorgan
jonathanmorgan / Data_and_databases.ipynb
Last active January 12, 2017 11:31
Data and databases - SQL and Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonathanmorgan
jonathanmorgan / APIs-getting_storing_using_data.ipynb
Last active January 12, 2017 11:31
APIs - getting, storing and using data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonathanmorgan
jonathanmorgan / Scraping_information_from_the_web.ipynb
Last active January 12, 2017 11:31
Scraping_information_from_the_web
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.