Skip to content

Instantly share code, notes, and snippets.

@quagly
quagly / pyenv-virtualenv-usage.md
Last active January 26, 2024 00:38
pyenv-virtualenv-usage

examples of using pyenv-virtualenv to manage python enviornments

references

create new virtual environment and auto-vivify in project

Check python version

The current python version will be the version used in your new virtual enviornment

@quagly
quagly / backup_files.sh
Created January 11, 2024 13:28
copy a couple of files to mount point dir
#!/usr/bin/env bash
# backup a couple of files into time machine backups
# main purpose it to make it easier to reinstall gentoo with similar setup
# run under mwest crontab
set -euf -o pipefail
# I don't want to leave /mnt/share mounted as it prevents hibernation of UTM
# So mount it if it is not mounted, and unmount it at the end if it wasn't mounted
declare IS_MOUNTED
@quagly
quagly / simh_compile.sh
Last active January 11, 2024 11:34
compile a few simh simulators
#!/usr/bin/env bash
#
# The nice cmake parallel compile system that simh offers fails
# on console only linux systems that do not have X11 / SDL / MESA graphical libraries
# as some sims require them. Perhaps there is some configuration for this.
# For now I am just compiling the couple of sims that I use single threaded.
# If this gets slow and/or annoying then look at cmake again.
set -euf -o pipefail
declare -rx GIT_DIR="${HOME}/repos/simh/.git"
@quagly
quagly / .md
Last active January 9, 2020 14:56
git-commands
@quagly
quagly / create_spark_timeseries.scala
Created October 9, 2019 16:43
generate spark dataframe timeseries
val start_dttm = Timestamp.valueOf("2019-01-01 00:00:00")
val inlineDf = (1 to 4).map { i => ((new Timestamp(start_dttm.getTime() + 60000 * i) , i)) }.toDF("eventTime","eventValue")
display(inlineDf)
@quagly
quagly / Cypher RelTypes
Last active December 30, 2015 15:59
Example of not able to get distinct relationship types from all paths
//console
//setup
//hide
Initialize Graph
[source,cypher]
----
CREATE
( socrates:Philosopher {name:'Socrates', uri: 'http://dbpedia.org/resource/Socrates' })
, ( plato:Philosopher {name:'Plato', uri: 'http://dbpedia.org/resource/Plato' })
= graphGist generated from spock test Neo4jCypherOneRelationship.groovy
graphGist asciiDoc file for use at http://gist.neo4j.org/ [GitHub Gist]
Generated on Mon Jul 29 07:11:04 PDT 2013
//console
= graphGist generated from spock test Neo4jCypherErasAndSchools.groovy
graphGist asciiDoc file for use at http://gist.neo4j.org/ [GitHub Gist]
Generated on Sun Jul 28 08:03:43 PDT 2013
//console
Initialize Graph
@quagly
quagly / OneNode
Last active December 20, 2015 08:09
= graphGist generated from spock test Neo4jCypherOneNode.groovy
graphGist asciiDoc file for use at http://gist.neo4j.org/ [GitHub Gist]
Generated on Sun Jul 28 08:03:44 PDT 2013
//console
query to create one node with one property
@quagly
quagly / OneLabel
Last active December 20, 2015 08:09
= graphGist generated from spock test Neo4jCypherOneLabel.groovy
graphGist asciiDoc file for use at http://gist.neo4j.org/ [GitHub Gist]
Generated on Sun Jul 28 08:03:43 PDT 2013
//console
query to create plato with philosopher label