Skip to content

Instantly share code, notes, and snippets.

@asessa
asessa / soundcloud.sh
Created February 22, 2017 11:52
Retreive SoundCloud access_token via Bash
#!/bin/bash
echo -n "Client ID: "
read CLIENT_ID
echo -n "Client Secret: "
read -s CLIENT_SECRET
echo
echo -n "Username: "
read username
echo -n "Password: "
read -s password
@asessa
asessa / StrPad.go
Created September 6, 2016 22:48
golang padding strings
package util
import (
"math"
"strings"
)
// StrPad returns the input string padded on the left, right or both sides using padType to the specified padding length padLength.
//
// Example:
@asessa
asessa / console.log.txt
Created June 2, 2016 09:22
colored console message :)
var logo = "%c \n" +
" \n" +
" ,, ,, \n" +
" `7MM `7MM \n" +
" MM MM \n" +
" ,p6\"bo ,pW\"Wq.`7MMpMMMb. ,pP\"Ybd ,pW\"Wq. MM .gP\"Ya MM ,pW\"Wq. .P\"Ybmmm \n" +
"6M' OO 6W' `Wb MM MM 8I `\" 6W' `Wb MM ,M' Yb MM 6W' `Wb :MI I8 \n" +
"8M 8M M8 MM MM `YMMMa. 8M M8 MM 8M\"\"\"\"\"\" MM 8M M8 WmmmP\" \n" +
"YM. , YA. ,A9 MM MM L. I8 YA. ,A9 MM YM. , ,, MM YA. ,A9 8M \n" +
" YMbmd' `Ybmd9'.JMML JMML.M9mmmP' `Ybmd9'.JMML.`Mbmmd' db .JMML.`Ybmd9' YMMMMMb \n" +
@asessa
asessa / backup_mysql.sh
Last active June 6, 2016 09:03
Backup each MySQL Databases in separate tar.xz files
#!/usr/local/bin/zsh
# Backup each MySQL Databases in separate tar.xz files
# MAX_DAYS - choose how many days to backup
# depends on ~/.my.cnf
BACKUP_DIR="/var/backups/mysql"
EXCLUDE_DBS=(information_schema mysql performance_schema sys)
CURRENT_DATE=`date +\%Y-\%m-\%d`
MAX_DAYS=2
@asessa
asessa / gist:bf389070d76aaaf3987b
Created June 7, 2015 23:33
node-html-pdf header/footer test
var pdf = require('html-pdf');
var options = {
'format': 'A4',
'border': '1cm',
'header': {
'height':'5cm'
},
'footer': {
'footer': '5cm'