Skip to content

Instantly share code, notes, and snippets.

function dbConnect($sql_hostName, $sql_Username, $sql_Password, $dbName = '') {
$server = $sql_hostName;
$name = $dbName;
$username = $sql_Username;
$password = $sql_Password;
$dsn = 'mysql:host='.$server.';dbname='.$name;
try {
$db = new PDO($dsn, $username, $password);
@waaronking
waaronking / fibonacci.js
Created October 15, 2015 17:43 — forked from jshcrowthe/fibonacci.js
Fibonacci Sequence (The cool way)
var fibonacci = function(n) {
return Array.apply(null, Array(n))
.reduce(function(sequence, value, index) {
return sequence.concat((index < 2) ? index : sequence[index - 1] + sequence[index - 2]);
}, []);
};