Skip to content

Instantly share code, notes, and snippets.

View w3cj's full-sized avatar
🌱

CJ w3cj

🌱
View GitHub Profile
function countLetters(input) {
// a place to store the counters
var counters = {};
// get the length of the input string
input = input.toLowerCase();
// iterate over the chars of the string
for (var i = 0; i < input.length; i++) {
// get with callbacks
function get(url, success, error) {
var ajax = new XMLHttpRequest();
ajax.onreadystatechange = function() {
if (this.readyState === 4) {
if (this.status === 200) {
var result = JSON.parse(this.responseText);
success(result);
getUserData().then(function (userData) {
return getUserMessages(userData.id).then(function(userMessages){
return { userData: userData, userMessages: userMessages }
});
}).then(function (result) {
return getUserLocation(result.userData.id).then(function(userLocation){
result.userLocation = userLocation;
return result;
});
}).then(function(result){
var express = require('express');
var app = express();
app.set('view engine', 'jade');
app.get('/', function(request, response){
response.render('index', { title: 'Hey', message: 'Bye World'})
// var options = {
// root: __dirname,
// dotfiles: 'deny',
var http = require('http');
var fs = require('fs');
var url = require('url');
var path = require('path');
var app = http.createServer(function(request, response) {
var parsedURL = url.parse(request.url, true);
console.log(parsedURL);
fs.readFile(path.join('.', parsedURL.pathname), 'utf8', function(err, contents) {
if (err) {

1. Installing postgres

brew doctor

IFF only warnings showed up during the previous command:

2. Install postgres

knex Review

<style> span { color: green; } </style>

Authentication and Authorization Review


What is authentication?

Who you are


// Output:
//
// {
// "optimize" : { count: 1, people: ["Ila Huels"] },
// "web-enabled" : { count: 1, people: ["Ila Huels"] },
// "supply-chains" : { count: 1, people: ["Ila Huels"] },
// "brand" : { count: 2, people: ["Ila Huels", "Cristopher Feest"] },
// "sexy" : { count: 2, people: ["Ila Huels", "Cristopher Feest"] },
// "channels" : { count : 2, people : ["Ila Huels", "Cristopher Feest"] },
// "envisioneer" : { count: 1, people: ["Ila Huels"] },

git development -> production deployment workflow

Working with 2 separate repos to store your development and production code bases.

In your development repository directory:

Add a remote for the production repository:

git remote add production [email protected]:user/production.git