List of data APIs that require no server-side auth or private credentials, and are thus good for small browser-only JS projects.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -------------------------------------------------------------------------------------- | |
// 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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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; | |
} | |
} |
- 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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
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
*** 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)
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 | |
*/ |
OlderNewer