Skip to content

Instantly share code, notes, and snippets.

View giobyte8's full-sized avatar

Giovanni Aguirre giobyte8

View GitHub Profile
@giobyte8
giobyte8 / sublime-config.json
Last active August 29, 2015 14:00
This is my configuration for Sublime Text 2/3 ... I use this file to reset/set my config on each machine where I work with Sublime.
{
"auto_complete_commit_on_tab": true,
"bold_folder_labels": true,
"caret_style": "smooth",
"color_scheme": "Packages/Oceanic Color Scheme/Themes/Oceanic.tmTheme",
"fade_fold_buttons": false,
"font_face": "Monaco",
"font_size": 14,
"highlight_line": true,
"highlight_modified_tabs": true,
@giobyte8
giobyte8 / chat.html
Last active August 29, 2015 14:08
Parte 1 | Creando un sistema de chat sobre NodeJS con Socket.IO, ExpressJS, MongoDB, Foundation y Openshift
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Chat room</title>
</head>
<body>
<h3>Messages:</h3>
<ul id="list-msgs">
@giobyte8
giobyte8 / server.js
Created October 26, 2014 01:35
Parte 1 | 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
*/
/* Librerias necesarias para la aplicación */
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io')(http);
@giobyte8
giobyte8 / UsersDAO.js
Created November 7, 2014 05:01
Parte 2 | Creando un sistema de chat sobre NodeJS con Socket.IO, ExpressJS, MongoDB, Foundation y Openshift
/* Util para encriptar el password del usuario */
var bcrypt = require('bcrypt-nodejs');
/**
* Data Access Object (DAO) para 'users',
* Debe ser construido con un objeto conectado a la
* base de datos
*/
function UserDAO(db) {
@giobyte8
giobyte8 / signup.html
Created November 7, 2014 05:32
Parte 2 | Creando un sistema de chat sobre NodeJS con Socket.IO, ExpressJS, MongoDB, Foundation y Openshift
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Signup to chat team SS</title>
</head>
<body>
<h1> Signup to chat team SS</h1>
<form id="signup-form">
<label for="username">Username</label><br>
@giobyte8
giobyte8 / chat.html
Created November 7, 2014 06:49
Parte 2 | Creando un sistema de chat sobre NodeJS con Socket.IO, ExpressJS, MongoDB, Foundation y Openshift
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Chat room</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/foundation.min.css">
</head>
<body>
@giobyte8
giobyte8 / server.js
Created November 7, 2014 07:00
Parte 2 | 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
*/
/* Librerias necesarias para la aplicación */
var bodyParser = require('body-parser');
var express = require('express');
@giobyte8
giobyte8 / VBAConnToAccess.vba
Created November 8, 2014 21:57
VBA Connect to Access DB From Excel
Sub DBGetUsers()
Dim DBLearningVBA As Database
Dim RSUsers As Recordset
Dim dbPath As String
Dim dbName As String
dbPath = "C:\Users\Giovanni\Documents\"
dbName = "LearningVBA.mdb"
Set DBLearningVBA = OpenDatabase(dbPath & dbName) 'Open database
/**
* Search all places in 'stores' collection that be 'near' of a given
* coordinates within a max distance of 2000 meters. collection 'stores'
* has a 2DSphere index on 'location'
*/
db.stores.find({
location: {
$near: {
$geometry: {
type: "Point",
@giobyte8
giobyte8 / mongodb_create-replica_set.sh
Created November 30, 2014 00:39
How to create a replica set in mongodb (Taken from M101JS Course)
#!/usr/bin/env bash
# Create directories for data
mkdir -p /data/rs1 /data/rs2 /data/rs3
# Start 3 server processes on three diferent ports
mongod --replSet m101 --logpath "1.log" --dbpath /data/rs1 --port 27017 --oplogSize 64 --fork --smallfiles
mongod --replSet m101 --logpath "2.log" --dbpath /data/rs2 --port 27018 --oplogSize 64 --smallfiles --fork
mongod --replSet m101 --logpath "3.log" --dbpath /data/rs3 --port 27019 --oplogSize 64 --smallfiles --fork