Skip to content

Instantly share code, notes, and snippets.

View celestelayne's full-sized avatar
🌴
coding

Celeste celestelayne

🌴
coding
View GitHub Profile
// --------------------------------------------------------------------------------------
// A More Modern Scale for Web Typography
// Based on this article: http://typecast.com/blog/a-more-modern-scale-for-web-typography
// --------------------------------------------------------------------------------------
$body-font-size: 1em !default;
// Adjusts body typography to be default
// for each browser.
@mixin reset-body-font-size($font-size: 100%, $size-adjustment: 0.5) {
@celestelayne
celestelayne / gist:77cf424a123547a10c4c
Created May 5, 2015 18:32
Assignment :: Constructors & Prototypes
// Make a Dice constructor that takes a numberOfSides. Add a method called roll that randomly returns a number from 1 up to the numberOfSides.
// Modify your roll method to record the returned side in a lastRoll property.
function Dice(numberOfSides) {
this.numSides = numberOfSides;
this.roll = function () {
return Math.floor(Math.random() * (numberOfSides - 1)) + 1;
}
}
@celestelayne
celestelayne / gist:31c9f8baecfcf3a4c337
Created May 16, 2015 04:30 — forked from afeld/gist:4952991
API Data List { No Auth Needed }
@celestelayne
celestelayne / Project-One.md
Last active August 29, 2015 14:21
Project One :: ArtMapr MVP

CORE REQUIREMENTS

  • Express API Implemented a backend API Express that serves up an html page(s) and a JSON API.
  • RESTful Routes Design the routes in a RESTful manner.
  • MongoDB Persist at least two models in a Mongo Database.
  • AJAX Leverage the backend API to fetch JSON asynchronously to the client.
  • jQuery Use jQuery to manipulate the DOM and/or data on the client-side.
  • Templating Render the JSON data on the frontend using underscore templates.
  • Authentication Enable users to signup, login, and logout.
  • Data Validation Validate data by handling incorrect inputs during sign up, such as unique email addresses, and minimum password lengths.
@celestelayne
celestelayne / 20150602HW.rb
Created June 3, 2015 19:21
GA WDI18 2015 06 02 Homework Submission
# 1
def generate_username1(name)
new_name = name.downcase
new_name.each_char.first
end
# 2
def generate_username2(fname, lname)
if fname == "" || lname == ""
nil
@celestelayne
celestelayne / 20150605AM.md
Created June 5, 2015 19:06
GA WDI18 2015 06 05 Morning Lecture {Ruby Classes & Modules Review}

JavaScript MasterClass

Q: What is a module? A: A collection of methods ... composes things together How different? mainly using modules to compose

Q: What is a class? A: A collection of methods and data ... blueprint for behavior of those methods How different? mainly using inheritance

@celestelayne
celestelayne / css-animations.md
Last active August 29, 2015 14:24
Lightning Talk :: CSS Animations

CSS ANIMATIONS

Topics:

  • Animations
  • Transitions
  • Vendor Prefixes - What are they and why do we need them?

ANIMATIONS

CSS Animations are made up of two basic building blocks:

  • Keyframes
@celestelayne
celestelayne / importJSONtoMongo.md
Last active August 29, 2015 14:27
Import JSON to MongoDB

*** Using mongoimport

mongoimport --db artmapr --collection arts --type json --file models/sf_data.json --jsonArray

  • cd /usr/local
  • RUN mongod (in separate terminal window)
  • ./bin/mongo
  • db

  • show dbs (lists all databases)
@celestelayne
celestelayne / Contract Killer 3.md
Created February 13, 2016 19:49 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: October 8th 2015
  • Original post

@celestelayne
celestelayne / simple-server-recurse
Last active December 18, 2016 03:40
Simple database server
/*
Before your interview, write a program that runs a server that is accessible on http://localhost:4000/. When your server receives a request on http://localhost:4000/set?somekey=somevalue it should store the passed key and value in memory. When it receives a request on http://localhost:4000/get?key=somekey it should return the value stored at somekey.
During your interview, you will pair on saving the data to a file. You can start with simply appending each write to the file, and work on making it more efficient if you have time.
http://localhost:4000/set?name=harold
http://localhost:4000/get?key=name
*/