Skip to content

Instantly share code, notes, and snippets.

View giobyte8's full-sized avatar

Giovanni Aguirre giobyte8

View GitHub Profile
@giobyte8
giobyte8 / server.js
Created April 1, 2015 03:13
Parte 3 | Creando un sistema de chat sobre NodeJS con Socket.IO, ExpressJS, MongoDB, Foundation y Openshift
/**
* Server.js
* @author : DiganmeGiovanni | https://twitter.com/DiganmeGiovanni
* @Created on: 25 Oct, 2014
* Updated on: 29 March, 2015
*/
/* Librerias necesarias para la aplicación */
var express = require('express');
@giobyte8
giobyte8 / MessagesDAO.js
Created April 1, 2015 03:00
Parte 3 | Creando un sistema de chat sobre NodeJS con Socket.IO, ExpressJS, MongoDB, Foundation y Openshift
/**
* Data Access Object (DAO) para 'messages'
* Debe ser construido con un objeto conectado a la
* base de datos
*
* @Created on: 29 March, 2015
*/
function MessageDAO(db) {
@giobyte8
giobyte8 / server_f01.js
Created April 1, 2015 03:25
Parte 3 | Creando un sistema de chat sobre NodeJS con Socket.IO, ExpressJS, MongoDB, Foundation y Openshift
socket.on('latest messages', function () {
messagesDAO.getLatest(50, function (err, messages) {
if (err) console.log('Error getting messages from history');
socket.emit('latest messages', messages);
});
});
@giobyte8
giobyte8 / server-static-routing.js
Created August 16, 2015 06:11
Parte 4 | Creando un sistema de chat sobre NodeJS con Foundation
/** css and js static routes */
app.get('/css/foundation.min.css', function (req, res) {
res.sendFile(__dirname + '/views/css/foundation.min.css');
});
app.get('/css/normalize.css', function (req, res) {
res.sendFile(__dirname + '/views/css/normalize.css');
});
app.get('/css/chat.css', function (req, res) {
@giobyte8
giobyte8 / server.js
Last active August 29, 2015 14:27
Parte 5 | Creando un sistema de chat sobre NodeJS con Foundation y Openshift
/**
* Server.js
* @author : DiganmeGiovanni | https://twitter.com/DiganmeGiovanni
* @Created on: 25 Oct, 2014
* Updated on: 15 Aug, 2015
*/
// ====================================================== //
// == MODULOS REQUERIDOS PARA LA APLICACIÓN
@giobyte8
giobyte8 / chat.css
Created August 16, 2015 06:05
Parte 4 | Creando un sistema de chat sobre NodeJS con Foundation
/**
* Chat SS Styles
*
* @author : DiganmeGiovanni | https://twitter.com/DiganmeGiovanni
* @Updated at: Aug 16, 2015;
*/
@import url(http://fonts.googleapis.com/css?family=Roboto:400,700);
@giobyte8
giobyte8 / chat.html
Last active August 29, 2015 14:27
Parte 4 | Creando un sistema de chat sobre NodeJS con Foundation Framework
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Chat room</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/foundation.min.css">
<link rel="stylesheet" href="css/chat.css">
@giobyte8
giobyte8 / downloadServer.js
Created August 16, 2015 23:19
A simple nodejs file server (Server to download files)
/**
* Simple server to download files over network
*
* @author: Giovanni Aguirre | twitter: @DiganmeGiovanni
* @Created on: Aug 16, 2015
*/
// Importa y configura los modulos necesarios
@giobyte8
giobyte8 / CreateTables.sql
Created August 31, 2015 05:51
Small script to create a sample database (Parking schema)
-- Create table ESTACIONAMIENTO
CREATE TABLE ESTACIONAMIENTO(
ID INT AUTO_INCREMENT PRIMARY_KEY,
NOMBRE VARCHAR(150),
COSTO_HORA INT NOT NULL,
COSTO_FRACCION INT NOT NULL
);
CREATE TABLE CAJON(
@giobyte8
giobyte8 / cmus-solmin
Created April 24, 2015 07:22
CMUS | Theme based on dark solarized
# Giovanni Color Scheme for Cmus player ...
#
# This theme is designed to be 1) Very readable on high-resolution or blurry
# displays (dying CRTs and TVs, for example). 2) Be more accessable to color-
# blind people, by removing chroma cues in favor of brightness and color
# inversion. 3) Show how to incorperate named and numbered colors into a
# single theme. 4) Provide a stating point for creating other mono-chromatic
# themes.
#
# Questions, comments (just a heads-up that you use/like this, especially),