Skip to content

Instantly share code, notes, and snippets.

View sgnl's full-sized avatar
🍪
Do you agree to share your cookies?

Ray Farias sgnl

🍪
Do you agree to share your cookies?
  • Hawaii
View GitHub Profile
@sgnl
sgnl / README.md
Last active August 29, 2015 14:25
Pizza-Express

Set up an Express server and a Postgres server running.

Express will be using Sequelize to connect to Postgres.

In Postgres, there will need to be a Users table with these column names and their DataTypes:

Column Name DataType
username STRING
password STRING
@sgnl
sgnl / zengardendump.css
Last active August 29, 2015 14:25
CSS from Zen Garden's front page
@import url(http://fonts.googleapis.com/css?family=Julius+Sans+One|Libre+Baskerville:400,400italic);
* {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html, body {
padding: 0;
margin: 0;
@sgnl
sgnl / postgres-brew.md
Last active November 29, 2024 08:26
Installing Postgres via Brew (OSX) (outdated see top most note)

Outdated note: the process is a lot easier now: after you brew install postgresql you can initialize or stop the daemon with these commands: brew services start postgresql or brew services stop postgresql.

new out put may look like

To have launchd start postgresql now and restart at login:
  brew services start postgresql
Or, if you don't want/need a background service you can just run:
  pg_ctl -D /usr/local/var/postgres start
@sgnl
sgnl / throwing-darts.md
Last active November 27, 2023 04:15
Throwing Darts

Throwing Darts

You've just recently been hired to calculate scores for a Dart Board game

Scoring Specs

  • 0 points: radius above 10
  • 5 points: radius between 5 and 10 inclusive
  • 10 points: radius less than 5

Some specifications to follow

  • An empty collection should return -1.
@sgnl
sgnl / mutidimensionalArraySearch.md
Last active August 29, 2015 14:25
Multidimensional Array Search

Multidimensional Array Search

Find an element if it exists in a collection of arrays within arrays.

Specs

Write a function named "locate" that takes two arguments, a multidimensional array of values and a target. This function returns true if the target value exist in a multidimentional array otherwise it returns false

Example:

locate(['a','b',['c','d',['e']]],'e'); // should return true

locate(['a','b',['c','d',['e']]],'a'); // should return true

@sgnl
sgnl / palindromeNumberGenerator.md
Last active June 15, 2020 01:22
Palindromic Number Generator

Palindromic Number Generator

When given a positive number value, return a palindromic number and how many steps it took to reach that number.

Specs

Create a function named palindromeNumberGenerator which takes a Number value. Check if the number is a Palindromic Number, if it's not then add together the value and the value-reversed and check if the sum is a palindromic number, repeat until you reach a palindromic number value. Each time you sum up the values to get a new number to check, increase the step count by 1.

Input will always be a positive integer.

Requirements

  • Create a Git Repository for this challenge
@sgnl
sgnl / bowlingScoreCalculator.md
Last active October 5, 2019 20:36
Bowling Score Calculator

Bowling Score Calculator

Your task is to write a function for calculating the score of a 10 pin bowling game. The input for this function will be an array of objects, and each object represents one frame. The objects can have any properties and values you see fit. Figuring out your input's data structure is part of the challenge.

Requirements

  • Create a Git Repository for this challenge
    • commit often and have your commit messages be descriptive
  • Write tests for your function using the Mocha and Chai.
    • Provide test for all cases. Handle unexpected inputs, invalid arguments, etc.

General rules

@sgnl
sgnl / intro-mongo.md
Last active February 5, 2016 23:50
MongoDB... COME ON DOOOOOOOWN

Before starting run the commands brew doctor and then brew update

Unix Users please install using the docs

Install Mongodb via Homebrew

$ brew install mongodb

Once brew is done installing, take note of the Caveats section that is printed to your console. Just like what we did previously for postgres it might be best to create a symlink then two aliases to start and stop the mongo progress.

  • Start your mongodb service
@sgnl
sgnl / chirp.md
Last active June 15, 2020 01:21
Chirp-Chirp

Getting Started

  • Create your own git repository for this exercise.
  • Commit often with meaningful commit messages.

Goal

Chirp Chirp Chirp Chirp

Specs

Create a function that accepts a single argument which will be a Number. This function will return a string with the word "Chirp" based on the number passed in when invoked.

@sgnl
sgnl / README.md
Last active August 29, 2015 14:26
Seed The Data