Skip to content

Instantly share code, notes, and snippets.

@nashid
nashid / condaenv.txt
Last active June 24, 2021 07:12 — forked from pratos/condaenv.txt
To package a conda environment (Requirement.txt and virtual environment)
# For Windows users# Note: <> denotes changes to be made
#Create a conda environment
conda create --name <environment-name> python=<version:2.7/3.5>
#To create a requirements.txt file:
conda list #Gives you list of packages used for the environment
conda list -e > requirements.txt #Save all the info about packages to your folder
@nashid
nashid / install_packages_conda.sh
Last active June 24, 2021 06:56 — forked from luiscape/install_packages.sh
Install Python dependency packages from requirements.txt Using conda.
#
# Original solution via StackOverflow:
# http://stackoverflow.com/questions/35802939/install-only-available-packages-using-conda-install-yes-file-requirements-t
#
#
# Install via `conda` directly.
# This will fail to install all
# dependencies. If one fails,
# all dependencies will fail to install.
@nashid
nashid / private_fork.md
Created June 23, 2021 04:35 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@nashid
nashid / .gitconfig
Last active February 22, 2021 08:18 — forked from lifuzu/.gitconfig
Three levels of GIT config
# There are 3 levels of git config: global, project, and system.
# global: Global configs are available for all projects for the current user and stored in ~/.gitconfig.
# project: Project configs are only available for the current project and stored in .git/config in the project's directory.
# system: System configs are available for all the users/projects and stored in /etc/gitconfig.
# Create a global config
$ git config --global user.name "John Doe"
# Create a project specific config, you have to execute this under the project's directory.
@nashid
nashid / MonadAndFs2Ops.md
Created March 6, 2019 19:48 — forked from Daenyth/MonadAndFs2Ops.md
Cheat sheet for common cats monad and fs2 operation shapes
Operation Input Result Notes
map F[A] , A => B F[B] Functor
apply F[A] , F[A => B] F[B] Applicative
(fa, fb, ...).mapN (F[A], F[B], ...) , (A, B, ...) => C F[C] Applicative
(fa, fb, ...).tupled (F[A], F[B], ...) F[(A, B, ...)] Applicative
flatMap F[A] , A => F[B] F[B] Monad
traverse F[A] , A => G[B] G[F[A]] Traversable; fa.traverse(f) == fa.map(f).sequence; "foreach with effects"
sequence F[G[A]] G[F[A]] Same as fga.traverse(identity)
. . . .
@nashid
nashid / sequence.scala
Created March 4, 2019 23:50 — forked from cb372/sequence.scala
Using Cats Traverse to turn a List of Try into a Try of List
Welcome to the Ammonite Repl 0.8.0
(Scala 2.11.8 Java 1.8.0_91)
@ import scala.util.Try
import scala.util.Try
@ val listOfTries: List[Try[String]] = List(Try("a"), Try("b"), Try("c"))
listOfTries: List[Try[String]] = List(Success("a"), Success("b"), Success("c"))
// I have a List[Try[String]] but I actually want a Try[List[String]].