I can’t remember the last time I touched a git UI client. It just seems odd, once you get familiar with the git CLI.
git command --help
Works for arbitrary sub-commands too:
git command subcommand --help
Initializes a git repo in the working directory:
Notice: All git stuff is stored in the
.gitfolder. Simply delete
.gitif you want to start over. Just be aware everything git related will be gone —it will be as if git never was there.
git remote add origin repo_url
My usual routine when I start a new project:
The key pair will be used for authentication. You will get 2 files, one is the private key, and the other the public key. The private key is what stays on your host machine. The public key is what you distribute to other systems.
The system can now verify that you are authorized; when you send some data signed (encrypted) with your private key, the system can decrypt it with the deposited public key. The keys are complementary to each other. One can undo the operation of the other. That allows you to prove your identity without sharing the tool for proofing it (the private key). Just make sure you never share the private key. …
As developers, we spend a large portion of our time writing code. As a consequence, we seek to grow the crafts of coding by looking for guides and habits that help us produce more clean and maintainable code. But is code really the sole source of value in a software project? I doubt it.
Code may get the job done, but it is only the outcome of a long thinking process. If one had to track down the true value in a software project, I’d argue that it lays in the thinking processes and the final ideas arising from them, ultimately being translated into executable code. But are these ideas fully captured with code alone? …
Even though not always obvious at a first glance, GitHub offers many useful tools besides hosting a git repository. Today’s topic:
I’ll show you how to publish a Maven package to your GitHub repo using Gradle — Something that is also covered by the GitHub documentation. I will complement it with some hints that were not completely obvious to me when I was first publishing.
If you’re the no-talk-just-example kind of type; here’s the gist.
Authentication is done with a token, so let’s begin with creating one.
Take a prime number
p and another integer
x != p, using those two numbers you are able to reach all integers out there in ℤ. All you need is a linear combination of
p as a prime number does not share any divisor with
x, except for the number 1. Hence the greatest common divisor
gcd(p,x) is equal to 1.
Using extended euclidean algorithm, we can trace down the way to
gcd(p,x) while retaining each intermediate result as a linear combination of
Today I had a pleasurable experience with Docker multi-stage builds and the
COPY --from build command. Docker multi-stage builds allow you to reduce the final image size and complexity by using multiple
FROM statements in a single Dockerfile.
FROM statement introduces a new build stage, which can also be given a name using
FROM as name. The layers of all stages except for the last one will be erased after
docker build (i.e. the last
FROM starts the actual image that is being built.) During the build, artifacts can be copied from one stage to another using
COPY --from=name src dest (or a number, beginning at 0, for unnamed stages.) …
Lately I managed to setup a GitLab CI/CD deployment pipeline for a React Native app. In this article I would like to share my insights and learnings, along with a proposition for a working
.gitlab-ci.yml configuration whose operability has been proven in my latest studies project.
The goal is to deploy a React Native App to your own server in a GitLab CI/CD pipeline. As a result, new code gets immediately deployed as pushed to GitLab. Users will be able to start the app on iOS or Android by scanning a QR-Code or opening a hyperlink, given they have installed the Expo App (more on this in the Conceptual Overview). …
n, find its prime factorisation
Each natural number is composed of a unique product of indivisible numbers also called prime numbers. Prime numbers are the building blocks of natural numbers and the prime factorisation of a number is its unique fingerprint. The prime factorisation of 17'160 is:
17160 = 2*2*2*3*5*11*13
It is easy to validate a given finger print by multiplying the numbers together. It is rather hard to calculate the finger print of a given number. There is no simple operation like multiplication to receive the sequence of numbers in the prime factorisation. Still we know it must exist and the smallest possible number in this sequence is
O(log x) Multiplikationen berechnen.
a in jeder Iteration mit sich selber multiplizieren. So entsteht die Folge:
a^x kann nun berechnet werden, indem bestimmte Zahlen aus dieser Folge miteinander multipliziert werden. Es gilt nämlich:
a^(x+y) = a^x * a^y
Jede Dezimalzahl lässt sich als Summe von 2er Potenzen darstellen (Binärdarstellung). Beispiel:
27 = 2^0 + 2^1 + 2^3 + 2^4 = 1 + 2 + 8 + 16
a^27 könnte man dementsprechend wie folgt schreiben:
a^(1+2+8+16) = a^1 * a^2 * a^8 * a^16
Das sind alles Glieder aus der obig beschriebenen Folge. Wenn man also die richtigen Glieder aus der Folge miteinander multipliziert erhält man
a^x. Mit einem Beispiel lässt sich wohl besser als mit Worten zeigen, wie diese Glieder selektiert…
Writing code is like art, so is the process of collaboration. You can always seek to improve and become a better collaborator. This article is about what I have learned during my time as a code collaborator. Not everything may hold true for you. It may not even hold true for myself, because I try to constantly evolve my own experiences. Rather it represents a snapshot of my experience and you can take out whatever’s useful to you and throw away the rest.
When writing code, we spend a lot of time thinking. I often get lost in my head from all that thinking. It’s essential to know what you are working on. This is why I keep myself close to the issues I’m working on. They remind me of what I’m truly supposed to solve. You can make a branch for every issue to help you stay on track. Name the branch after the issue‘s ID, this way you increase the traceability for you and all collaborators. Only add code to this branch that is related to your issue. Go back to your issue and read the specification if you get lost somehow. I catch myself so often, trying to solve a problem that is not even relevant for what I was initially supposed to solve. …