Skip to content

Instantly share code, notes, and snippets.

View baras's full-sized avatar

Yoav Baras baras

View GitHub Profile
@baras
baras / smb.conf
Created August 26, 2018 07:25
/etc/samba/smb.conf settings to share a folder on a Linux VirtualBox to be accessed from the Windows host.
Reference: https://superuser.com/a/258103
Add this to the bottom of the file:
[www]
comment = another share
path = /var/www
guest ok = yes
browseable = yes
read only = no
@baras
baras / smallest-positive-int-solution.php
Last active September 23, 2020 01:28
Given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A.
/**
* Finds the smallest positive integer which does not exist in an array.
*
* @param array $a
* The array to check.
*
* @return int
* The smallest positive integer not found in $a.
*/
function solution2(array $a) {