Skip to content

Instantly share code, notes, and snippets.

View chelorossi's full-sized avatar
🎯
Focusing

Marcelo Rossi chelorossi

🎯
Focusing
View GitHub Profile
@chelorossi
chelorossi / flatten_array.js
Last active March 15, 2018 04:39
SOLUTION - (Write some code, that will flatten an array of arbitrarily nested arrays of integers into a flat array of integers. e.g. [[1,2,[3]],4] -> [1,2,3,4]. )
/**
* flatten() returns a flattened array
* based on the passed-in nested integer array uiarray
* must preprocess (minify and uglify) with a tool like webpack to deploy in production
* Tested in Chrome latest (I would do some more testing)
*/
const flatten = function flattenIntegersArray(uiarray) {
//console.assert(Array.isArray(uiarray), 'is not an Array param uiarray');
var stack = uiarray.slice(0);
@chelorossi
chelorossi / samba
Created August 5, 2014 03:59
Samba Configuration Example (Ubuntu / Windows)
[global]
workgroup = EXAMPLE
security = user
map to guest = Bad User
[public]
comment = Public Share
path = /home/server/Downloads
browsable = yes
guest ok = yes
cheluskis@ubuntu:~/main$ sudo vagrant destroy
==> default: VM not created. Moving on...
cheluskis@ubuntu:~/main$ sudo vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'puphpet/centos65-x64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'puphpet/centos65-x64' is up to date...
==> default: Setting the name of the VM: main_default_1406758727998_64665
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
sudo apt-get purge vagrant
sudo apt-get purge virtualbox
apt-get install build-essential linux-headers-3.2.0-23-generic-pae # uname -r
sudo dpkg-reconfigure virtualbox-dkms
sudo dpkg-reconfigure virtualbox
sudo apt-get install vagrant