Excerpt from the README.rst
with some useful pointers:
- check the current channel
sudo nix-channel --list
- (optional) set a new channel
sudo nix-channel --remove nixos
sudo nix-channel --add https://nixos.org/channels/nixos-XX.YY nixos
My solutions to rustlings
are kept in a branch in my fork of the repo (markgreene74/rustlings:solutions
), and also in a separate repo rustlings_solutions
. After a rebase of the branch to main
some solutions need to be modified and the changes pushed.
This simple bash
script can be used to find the file modified so that thay can also be updated in rustlings_solutions
.
cd github
for src_file in $(find rustlings/exercises -type f -name "*.rs"); do \
dst_file=$(echo ${src_file} | sed 's/rustlings/rustlings_solutions/')
echo "Comparing ${src_file} and ${dst_file}";
>>> l = list(range(10))
>>> def f(l,d=False):
... for i in l:
... if d:
... l.remove(i)
... else:
... yield i
...
>>> list(f(l))
What is git and why is it so widely used?
git
is a very powerful version control system, but it's not the only one. You may have heard of mercurial, subversion, CVS ...
In simple and practical terms, it solves two very real problems:
- how can I keep track of the codebase I am working on
- how can I collaborate with other programmers/engineers/data scientist making changes on the same piece of code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/<USERNAME>/<REPOSITORY>/settings/branches | |
git branch -m master <BRANCH> | |
git fetch origin | |
git branch -u origin/<BRANCH> <BRANCH> | |
# example, change from master to main | |
git branch -m master main | |
git fetch origin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/pypa/pipenv | |
pip install --upgrade pip --user | |
pip install --upgrade pipenv --user | |
# https://pipenv.pypa.io/en/latest/install/#installing-packages-for-your-project | |
cd myproject | |
# install packages | |
pipenv install requests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl cluster-info | |
kubectl config view | |
kubectl describe nodes | |
kubectl describe pods --all-namespaces | |
kubectl get services --all-namespaces | |
kubectl api-resources -o wide |
(env) [lon1-01 tmp]$ cat something.py
def afunction(arg=None):
counter = 0
try:
arg += 1
except:
# do nothing, increase the counter
counter += 1
return counter
NewerOlder