Skip to content

Instantly share code, notes, and snippets.

@RopoMen
RopoMen / dotenv.sh
Created March 26, 2019 13:46
Bash script for .env file loading
#!/bin/bash
source logging_utils.sh
DOTENV_ENV="test"
DOTENV_BASE="./"
if [ ! -z $1 ]; then
DOTENV_ENV="$1"
@RopoMen
RopoMen / logging_utils.sh
Last active March 26, 2019 13:15
Set of logging helper functions that simplifies bash logging. Session ID helps to identify log rows that belong to same session and allows multiple scripts to use same logfile.
# For OSX https://unix.stackexchange.com/questions/141420/tr-complains-of-illegal-byte-sequence
export LC_ALL=C;
# https://gist.github.com/earthgecko/3089509
INTERNAL_SESSION_ID="$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 8 | head -n 1)"
function get_session_id() {
echo "$INTERNAL_SESSION_ID"
}
function get_logdate() {
@RopoMen
RopoMen / facebook_page_plugin.html
Created July 21, 2015 18:15
Simple way to resize Facebook's new Page plugin
<!--
Width 10000px is quite wide, but it has room for new "max", also because Facebook's "adaptation" means only shrinking
the Page plugin to fit smaller container. To use Page plugin with larger container than 500px (current max.) you could try
to add example Bootstrap class '.center-block' which would center the Page plugin inside larger container.
-->
<div class="row">
<div class="column-xs-6">
<div class="fb-page center-block" data-width="10000" data-adapt-container-width="true" data-href="https://www.facebook.com/facebook"></div>
</div>
</div>