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
Set-Alias ll ls | |
Set-Alias dc docker-compose | |
Set-Alias dcu dockerComposeUp | |
Set-Alias dcd dockerComposeDown | |
Set-Alias gfp gitFetchPull | |
function dockerComposeUp { | |
docker-compose up -d | |
} |
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
fn password_generate(len: i32) -> String { | |
let mut rng = rand::thread_rng(); | |
let mut password = String::from(""); | |
let lower_chars = String::from("abcdefghijklmopqrstuvwxyz"); | |
let upper_chars = String::from("QWERTYUIOPASDFGHJKLZXCVBNM"); | |
let number_chars = String::from("0987654321"); | |
let symbols_chars = String::from("$!@?%+,().-[];:><\\~#&|/_*"); | |
let mut chars_coll: Vec<char> = lower_chars.chars().collect(); |
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 ubuntu:18.04 | |
ENV TZ=America/Toronto | |
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | |
RUN apt-get update && apt-get upgrade -y && \ | |
apt-get install -y software-properties-common && \ | |
apt-get install -y git vim curl whois siege | |
RUN apt-get install -y php && \ |
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
ENV TZ=America/Toronto | |
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone |
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
ls -1 | wc -l && time find . -type f -delete |
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
# Call the 2 curl commands with your url and compare output results. | |
# If gzip/deflate is working, the 2 results should be different (second smaller). | |
# Without encoding header | |
curl http://example.com --silent --write-out "%{size_download}\n" -L --output /dev/null | |
# With gzip,deflate encoding header | |
curl http://example.com --silent -H "Accept-Encoding: gzip,deflate" --write-out "%{size_download}\n" --output /dev/null -L |
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
@echo off | |
cd /d "C:\Program Files\Oracle\VirtualBox" | |
VBoxManage.exe startvm "MyVm" --type headless |
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
function ImageLoader(url, callback, attempt_count, attempt_interval) { | |
var $this = this, | |
callback = callback, | |
src = url, | |
attempt = 0, | |
attempt_count = attempt_count || 5, | |
attempt_interval = attempt_interval || 500, | |
loaded = false, | |
intervalInstance; |
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
<?php | |
/** | |
* Generate an url from a string. | |
* Safe for french string. | |
* | |
* @param string $str The string you want to transform to url | |
* @param array $replace array of string(s) your to remove | |
* @param string $delimiter url space delimiter, - by default | |
* | |
* @return string |