Random Tips
This page is just a collection of random commands and such that
myself (or
others) have found useful. If you’d like to contribute, then send me a pull
request on Github.
-
GNU Parallel
Running a script with multiple arguments using GNU parrallel on UNIX. parallel -j 20 --ungroup python myscript.py {1} ::: val1 val2 val3 Replace 20 by the number of cores to use. --ungroup is used to display the output of the...
Read more.
-
Matplotlib
Here are three example plots using matplotlib. Each function takes in arguments of type list. import numpy as np import matplotlib.pyplot as plt def plot_deg_dist(x_list): x = np.array(x_list) fig = plt.figure() plt.hist(x) fig.suptitle('Degree Distribution') plt.xlabel('Degree (d)') plt.ylabel('Frequency') plt.yscale('log', nonposy='clip') plt.show()...
Read more.
-
Is Gif said like Gif(t) or Jif?
See this page for a thorough and logical explanation of the correct pronunciation.
Read more.
-
Vim
Convert hard line breaks to soft wrap: In visual mode ipJ. Show whitespace characters: :set list. Open up a buffer with no name: enew for the current window, vnew for a new vertical split, new for a horizontal split. Fugitive...
Read more.
-
R
R is a wonderfully confusing language. Fortunately, people like Hadley Wickham are here to help. Therefore, most of these commands will be in the context of packages like dplyr and ggplot. If you are in need of some more general...
Read more.
-
Python
Style Information Check out Raymond Hettinger’s tips on writing beautiful python. Working with files Use os.path.realpath() to elegantly handle command line arguments that might be relative paths. Check out os.path.expanduser() if you want to properly handle ~. glob.glob('*.txt') will return...
Read more.
-
Omnigraffle
You can create curly braces using straight line segments with rounded corners. Make sure to use two control
points at the middle to make it look better. See here for more details.
Read more.
-
Neo4j
Clear database: MATCH (n) DETACH DELETE n
Visualize database; `MATCH (n) return n
Helpful Links
Introduction to Graph Databases and Neo4j.
12 Steps for a Performant Graph.
Read more.
-
Git
Change the remote for a repository: git remote add origin git@github.com:rjwalls/REPO_NAME.git #Or if origin exists already # git remote set-url origin git@github.com:rjwalls/REPO_NAME.git git push -u origin master Make a copy of the repository files without any git information: git archive...
Read more.
-
Bash
Learn to use Bash parameters: Create and move into a new directory: mkdir foo && cd "$_" Get the size of a file: du -sh file.txt. Want to clear your screen but typing clear is too much work? Use ctrl+L...
Read more.
-
Anki
Anki Mobile
To create a filtered deck for a particular jpod episode do the following:
Select the Jpod deck
Tools > More > Filter/Cram
Add “tag:102*” to the search bar.
Change “102” to the appropriate episode number.
Read more.