Skip to content

Instantly share code, notes, and snippets.

View armenr's full-sized avatar

Armen Rostamian armenr

View GitHub Profile
@armenr
armenr / Build a triangle with loops
Last active December 6, 2016 17:48
buildTriangle.js
function buildTriangle(numLines) {
var linesArray = [];
var iterations = numLines;
if (numLines < 1 ) {
return alert("Try a bigger number!")
}
for (var line = 1; line <= iterations; line++) { //start @ 1 instead of zero to avoid empty first index string
linesArray.push("#".repeat(line) + "\n");
@armenr
armenr / mysql_buffer_saver_restart_reload.sh
Last active November 3, 2016 07:21
Restart MySQL with buffer pool save & reload
#!/bin/bash
#
# Perform MySQL 5.6+ restart with buffer pool save and reload
# MySQL credentials
user=
pass=
# Exit on any command failure
set -e