This is guide about how to configure multiple SSH keys for some Git host websites such as Github, Gitlab, among others.
This file contains 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
curl \ | |
-X POST \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
-H "Authorization: Bearer <GITHUB PERSONAL ACCESS TOKEN>" \ | |
https://api.github.com/repos/octocat/hello-world/dispatches \ | |
-d '{"event_type":"event_type"}' |
This file contains 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
FROM : Base docker image (Ubuntu, Nginx, python3) | |
CMD : to run commands | |
RUN : to run commands (can also be used to build docker images) (RUN apt-get install -y python) | |
ENTRYPOINT : Commands mentioned in ENTRYPOINT are executed as soon as image is built. It overwrites the CMD commands | |
ADD : To copy files from host to container | |
ENV : For ENVIRONMENT variables | |
WORKDIR : To set where the command in CMD is to be executed | |
EXPOSE : To associate a port number to enable networking between the running process | |
MAINTAINER : | |
USER : To specify the user to run the container.(USER UID) |
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
- Stores data elements based on an sequential, most commonly 0 based, index.
- Based on tuples from set theory.
This file contains 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
def operations(operator, x, y): | |
return { | |
'add': lambda: x + y, | |
'sub': lambda: x - y, | |
'mul': lambda: x * y, | |
'div': lambda: x / y, | |
}.get(operator, lambda: None)() | |
>>> operations('mul', 2, 8) | |
16 |
This file contains 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
# Looping can be done using dict.keys(), dict.values() and dict.items() | |
>>> knights = {'gallahad': 'the pure', 'robin': 'the brave'} | |
# Using items(), we can retrieve key as well as value for each item | |
>>> for k, v in knights.items(): | |
print(k, v) | |
gallahad the pure | |
robin the brave |
This file contains 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
# Defining a dictionary | |
>>> tel = {'jack': 4098, 'sape': 4139} | |
# If dict keys are only string, we can define as below | |
>>> dict(sape=4139, guido=4127, jack=4098) | |
{'sape': 4139, 'jack': 4098, 'guido': 4127} | |
# Appending a new key value pair to the `tel` dict | |
>>> tel['guido'] = 4127 |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder