Skip to content

Instantly share code, notes, and snippets.

@srph
srph / slice.js
Last active September 30, 2016 06:25
js: slice that works from end to start (e.g., 1, 2, 3, 4, 5 -> slice(array, 3, 0) -> 4, 5, 1)
/**
* A `slice` function that works from taking
* ending positions to the starting positions
*
* @example
* slice(months, 11, 2) // ['Dec', 'Jan', 'Feb', 'Mar']
*
* @param {array} array Array to slice
* @param {start} start Starting position
* @param {end} end Ending position
@fideloper
fideloper / install.sh
Last active October 30, 2023 20:03
Vagrant Provisioning Script for PHP applications. This installs a LAMP stack.
#!/usr/bin/env bash
echo ">>> Starting Install Script"
# Update
sudo apt-get update
# Install MySQL without prompt
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'