Skip to content

Instantly share code, notes, and snippets.

View fcarlone's full-sized avatar

Frank Carlone III fcarlone

View GitHub Profile
@fcarlone
fcarlone / gist:df5c6cb3c42f997797968ba215ed4064
Last active May 2, 2016 23:34
JavaScript - Flatten Array
var flatten = function(array) {
var results = [];
for(var i = 0; i < array.length; i++) {
if(Array.isArray(array[i])) {
results = results.concat(flatten(array[i]));
} else {
results.push(array[i]);
}
}
@fcarlone
fcarlone / bloccit-rails-console-assignment
Created February 17, 2017 01:16
Bloc: bloccit - Assignment 16
[4] pry(#<Post>):1> nesting
Nesting status:
--
0. main (Pry top level)
1. #<Post>
[5] pry(#<Post>):1> self.to_s
=> "#<Post:0x007f8bc222b398>"
[6] pry(#<Post>):1> self.title = 'some new title'
=> "some new title"
[7] pry(#<Post>):1> self.body = 'some new body'
@fcarlone
fcarlone / gist:37ea273900bd84efa28f2be8cd3c3041
Created February 21, 2018 18:48
Module 5: Software Engineering Principles - Relational Database Fundamentals Checkpoint 2: Installing and Using Relational Databases
// $ psql -f Downloads/library-data.sql library postgres
// $ psql library postgres
// library-# SELECT * FROM books;
RESULT:
id | title | author
------+------------------------------------------+---------------------
1259 | Eloquent Ruby | Russell A. Olson
1593 | JavaScript: The Good Parts | Douglas Crockford
8982 | Designing Object-Oriented Software | Rebecca Wirfs-Brock
@fcarlone
fcarlone / index.html
Last active May 18, 2018 03:45
Memory Game Board Generator
<div class='container-fluid language-javascript' >
<!-- tabs -->
<ul class="nav nav-pills">
<li class="active">
<a href="#readme" data-toggle="tab">Readme</a>
</li>
<li>