Command | Description |
---|---|
docker build -t myimage:1.0 | Build an image from the Dockerfile in the current directory and tag the image |
docker image ls | List all images that are locally stored with the Docker Engine |
docker image rm alpine:3.4 | Delete an image from the local image store |
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
#!/usr/bin/env bash | |
REGIONS='us-east-1 (N. Virginia) | |
us-east-2 (Ohio) | |
us-west-1 (California) | |
us-west-2 (Oregon) | |
eu-central-1 (Frankfurt) | |
eu-west-1 (Ireland) | |
eu-west-2 (London) | |
eu-west-3 (Paris) |
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
//contents []byte | |
//package filetype | |
kind, err := filetype.Match(contents) |
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
package middlewares | |
import ( | |
"net/http" | |
"github.com/labstack/echo/v4" | |
) | |
// ServerHeader middleware adds a `Server` header to the response. | |
func MubashirMiddleware(next echo.HandlerFunc) echo.HandlerFunc { | |
return func(c echo.Context) error { |
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
let jspdf = document.createElement("script"); | |
jspdf.onload = function () { | |
let pdf = new jsPDF(); | |
let elements = document.getElementsByTagName("img"); | |
for (let i in elements) { | |
let img = elements[i]; | |
console.log("add img ", img); | |
if (!/^blob:/.test(img.src)) { | |
console.log("invalid src"); | |
continue; |
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
// Goroutines are lightweight, costing little more than the allocation of stack space. | |
// The stacks start small and grow by allocating and freeing heap storage as required. | |
// Internally goroutines act like coroutines that are multiplexed among multiple operating system threads. | |
// If one goroutine blocks an OS thread, for example waiting for input, other goroutines in this thread will migrate so that they may continue running. | |
// ----------------------------------------------------------------------------------------------------------------- | |
// You can start a new thread of execution, a goroutine, with the go statement. |
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
# Installing the Package: | |
pip install googleDriveFileDownloader | |
# Sample code: | |
from googleDriveFileDownloader import googleDriveFileDownloader | |
gdownloader = googleDriveFileDownloader() | |
gdownloader.downloadFile("https://drive.google.com/uc?id=1O4x8rwGJAh8gRo8sjm0kuKFf6vCEm93G&export=download") |
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
=begin | |
With bundler/inline there is no need to use external gems | |
it lets you download/install/activate gems directly in the script | |
skipping the need to handle bundle install or call it through bundle exec | |
=end | |
require 'bundler/inline' |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class objectControl : MonoBehaviour | |
{ | |
public float speed = 3.0f; | |
void Update() | |
{ |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class ObjectTransform : MonoBehaviour | |
{ | |
// Start is called before the first frame update | |
private Vector3 startPosition; | |
public bool changePosition, moveInCircles; |
NewerOlder