Skip to content

Instantly share code, notes, and snippets.

View CharlieRa's full-sized avatar

Carlos Ramart CharlieRa

  • Santiago, Chile
View GitHub Profile
@CharlieRa
CharlieRa / elb-nodejs-ws.md
Created October 3, 2017 20:24 — forked from obolton/elb-nodejs-ws.md
Configuring an AWS Elastic Load Balancer for a Node.js application using WebSockets on EC2

AWS ELB with Node.js and WebSockets

This assumes that:

  • You are using Nginx.
  • You want to accept incoming connections on port 80.
  • Your Node.js app is listening on port 3000.
  • You want to be able to connect to your Node.js instance directly as well as via the load balancer.

####1. Create load balancer

@CharlieRa
CharlieRa / gist:c743bb35a7e29b155ad75ed2ef3ebace
Created August 3, 2017 21:52 — forked from deizel/gist:9230ab493ada786358bf
List of constants in CakePHP 3.0
deizel at CakeDC in ~/Projects/cakephp (3.0●)
$ ag "const "
src/Console/ConsoleOutput.php
51: const RAW = 0;
58: const PLAIN = 1;
65: const COLOR = 2;
72: const LF = PHP_EOL;
src/Console/ConsoleIo.php
58: const VERBOSE = 2;
@CharlieRa
CharlieRa / README.md
Created June 16, 2017 20:35 — forked from zenorocha/README.md
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@CharlieRa
CharlieRa / gist:4e455605511a37c27e73
Created August 21, 2015 19:48
Script que convierte una fecha de GPS con epoch del 6 de Enero de 1980 a GMT 0 y GMT -3 de Santiago de Chile
#!/usr/bin/python
# Usage: python convert.py <gpsDate> - ej formato: 1858349648
import datetime
import sys
# 1858 3 49648
def convert(gpsDate):
epochDate = datetime.datetime.strptime("1980-1-6 00:00:00","%Y-%m-%d %H:%M:%S")
# print epochDate
week = gpsDate[0:4]
days = gpsDate[4:5]