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
<?php | |
/** | |
* ALERT! There are more than ten years since I wrote the first version (adaptation) of this code with PHP 5.6, | |
* then I changed my code stack and I couldn't mantain this code anymore. Ten years ago worked like a charm. | |
* Fell free to test, use, fork, update, etc. and if possible put in the comments how to fix, | |
* if it doesn't work for you as it is, so other people could find answers. | |
**/ | |
/** | |
* Get hearder Authorization |
First we'll update your local master
branch. Go to your local project and check out the branch you want to merge into (your local master
branch)
$ git checkout master
Fetch the remote, bringing the branches and their commits from the remote repository.
You can use the -p
, --prune
option to delete any remote-tracking references that no longer exist in the remote. Commits to master
will be stored in a local branch, remotes/origin/master
.
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
#!bin/bash | |
pwd=`pwd` | |
# Set the quality factor to 80 | |
qualityCompression=80; | |
# Set a minimum quality factor to 20 | |
qualityLimit=20; | |
# To run a new compression | |
second_run_compression=false; | |
# For batch compression |
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
<?php | |
/* | |
Creates a thumbnail keeping the aspect ratio of the source image, and | |
saves it to a destination $dest. | |
Credits: http://davidwalsh.name/create-image-thumbnail-php | |
*/ | |
function make_thumb($src, $dest, $desired_width) { | |
$info = getimagesize($src); |
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
FROM debian:stable-slim | |
RUN apt-get update | |
RUN apt-get install -y wget libgtk-3-dev libgtkextra-dev libgconf2-dev libnss3 libasound2 libxtst-dev libxss1 libx11-6 libx11-xcb-dev | |
# RUN wget https://github.com/trufflesuite/ganache/releases/download/v2.5.4/ganache-2.5.4-linux-x86_64.AppImage | |
RUN wget https://github.com/trufflesuite/ganache-ui/releases/download/v2.5.4/ganache-2.5.4-linux-x86_64.AppImage | |
RUN chmod +x ganache-2.5.4-linux-x86_64.AppImage | |
RUN ./ganache-2.5.4-linux-x86_64.AppImage --appimage-extract | |
RUN rm ganache-2.5.4-linux-x86_64.AppImage | |
ENV DISPLAY=host.docker.internal:0 |
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
i=1 | |
for avi in *.mp4; do | |
name=`echo $avi | cut -f1 -d'.'` | |
jpg_ext='.jpg' | |
echo "$i": extracting the first frame of the video "$avi" into "$name$jpg_ext" | |
ffmpeg -loglevel panic -i $avi -vframes 1 -f image2 "$name$jpg_ext" | |
i=$((i+1)) | |
done |
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
git clone https://github.com/vfarcic/cloud-provisioning.git | |
cd cloud-provisioning | |
scripts/dm-swarm.sh | |
eval $(docker-machine env swarm-1) | |
docker node ls |
NewerOlder