MongoDB Exercise in mongo shell
Connect to a running mongo instance, use a database named mongo_practice
.
Document all your queries in a javascript file to use as a reference.
# https://stackoverflow.com/a/17678331/2190689 | |
function git-pull-all() { | |
START=$(git symbolic-ref --short -q HEAD); | |
for branch in $(git branch | sed 's/^.//'); do | |
git checkout $branch; | |
git pull ${1:-origin} $branch || break; | |
done; | |
git checkout $START; | |
}; |
package main | |
import ( | |
"context" | |
"flag" | |
"log" | |
"net" | |
"net/http" | |
"net/http/httputil" | |
"net/url" |
FROM php:7.2-rc-zts-alpine | |
ARG APP_USER_USERNAME=app | |
RUN apk update && apk add --no-cache \ | |
sudo bash \ | |
g++ make autoconf \ | |
libxml2-dev icu-dev curl-dev pcre-dev | |
RUN adduser -D -s /bin/bash $APP_USER_USERNAME \ |
# Delete all containers
docker rm $(docker ps -aq)
# Delete all images
docker rmi $(docker images -q)
# Delete all untagged images
docker rmi $(docker images -q --filter "dangling=true")
# Delete unused images
docker system prune --all
RUN apt update | |
RUN apt upgrade -y | |
RUN apt install -y apt-utils | |
RUN a2enmod rewrite | |
RUN apt install -y libmcrypt-dev | |
RUN docker-php-ext-install mcrypt | |
RUN apt install -y libicu-dev | |
RUN docker-php-ext-install -j$(nproc) intl | |
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev | |
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ |
go get -u cloud.google.com/go/pubsub |
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" |
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" | |
"strconv" |
<?php | |
// Installed the need packages with Composer by running: | |
// $ composer require aws/aws-sdk-php | |
$filePath = "https://example.com/test.png"; | |
require 'vendor/autoload.php'; | |
$bucketName = 'YOUR_BUCKET_NAME'; | |
$filePath = './YOUR_FILE_NAME.png'; |