docker exect -it myimage /bin/bashdocker build --tag myimage:tag_name .docker container attach myimagedocker run -itd --name <name> --network <network> --publish 80:8080 myimage:tagdocker image tag myimage myrepo/myimage:tagdocker image push myrepo/myimage:tag
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
| class MyClass { | |
| MyClass() { | |
| APIManager manager = GameObject.FindWithTag("APIManager").GetComponent<APIManager>(); | |
| manager.StartCoroutine(MyFunction()); | |
| } | |
| IEnumerator MyFunction() { | |
| yield return "Hello World!"; |
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
| # Credit for gcd() method - https://stackoverflow.com/questions/11175131/code-for-greatest-common-divisor-in-python | |
| def gcd(a, b): | |
| """Calculate the Greatest Common Divisor of a and b. | |
| Unless b==0, the result will have the same sign as b (so that when | |
| b is divided by it, the result comes out positive). | |
| """ | |
| while b: | |
| a, b = b, a % b | |
| return a |
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
| encode_table = { | |
| 'a': "01", | |
| 'b': "02", | |
| 'c': "03", | |
| 'd': "04", | |
| 'e': "05", | |
| 'f': "06", | |
| 'g': "07", | |
| 'h': "08", | |
| 'i': "09", |
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
| import multiprocessing | |
| from threading import Thread | |
| import random | |
| import string | |
| class ThreadWorker(Thread): | |
| def __init__(self, *args, **kwargs): | |
| super().__init__(*args, **kwargs) |
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
| import RPi.GPIO as GPIO | |
| import os | |
| import time | |
| import math | |
| usleep = lambda x: time.sleep(x / 1000000.0) | |
| GPIO.setwarnings(False) | |
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
| # /etc/nginx/nginx.conf | |
| http { | |
| ... | |
| include /etc/nginx/sites-available/*.conf # Include all config files that end in .conf | |
| ... | |
| } | |
| # /etc/nginx/sites-available/example.com.conf | |
| server { | |
| listen 80 default_server; |
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
| {"lastUpload":"2020-06-04T20:13:28.728Z","extensionVersion":"v3.4.3"} |
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
| #!/usr/bin/env bash | |
| # Get the <token> through the GitHub website: | |
| # 1. Go to Settings->Developer Settings->Personal access tokens | |
| # 2. Create a token with the 'repo' scope selected. | |
| # https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token | |
| # The value for "event_type" should match "on.repository_dispatch.type" in workflow.yaml. | |
| curl -X POST \ | |
| -H "Accept: application/vnd.github.v3+json" \ |
OlderNewer