Skip to content

Instantly share code, notes, and snippets.

View edinsoncs's full-sized avatar
🤖
Working from home

Edinson CS edinsoncs

🤖
Working from home
View GitHub Profile
@edinsoncs
edinsoncs / 3.js
Created February 28, 2016 19:25
2 nodejs
//router basic
var http = require('http');
var url = require('url');
var routes = {
'GET':{
'/': function(req, res){
res.writeHead(2000, {'Content-type' : 'text/html'});
res.end('<h1>Hola que tal</h1>');
}
@edinsoncs
edinsoncs / 3.js
Created February 28, 2016 19:55
routes
//router basic
var http = require('http');
var url = require('url');
var qs = require('querystring');
var routes = {
'GET':{
'/': function (req, res){
res.writeHead(200, {'Content-type': 'text/html'});
@edinsoncs
edinsoncs / 4.js
Created February 28, 2016 20:44
nodejs view dirname html
var http = require('http');
var url = require('url');
var port = 3000;
var fs = require('fs');
var path = require('path');
var mimes = {
'.html': 'text/html',
'.css': 'text/css',
'.js': 'text/javascript',
'.gif': 'image/gif',
@edinsoncs
edinsoncs / 4.js
Created February 28, 2016 21:01
fs, url, http, nodejs
var http = require('http');
var url = require('url');
var port = 3000;
var fs = require('fs');
var path = require('path');
var mimes = {
'.html': 'text/html',
'.css': 'text/css',
'.js': 'text/javascript',
'.gif': 'image/gif',
@edinsoncs
edinsoncs / 1-javascript-html.html
Created March 11, 2016 05:33
javascript html 1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Ejercicios</title>
</head>
<body>
<dl id="abc">
<dt>Nombres</dt>
@edinsoncs
edinsoncs / readme.md
Created March 14, 2016 22:48 — forked from coolaj86/how-to-publish-to-npm.md
How to publish packages to NPM

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"

npm adduser

Empresas que usan Node en Argentina

  • flowics
  • MercadoLibre
  • DescuentoCity
  • IamAt
  • MuleSoft
function itemsDom(item, tag) {
var capture = document.getElementsByTagName(tag);
var item = capture.item(item);
if(item != 2) {
return item
}
else {
console.log(item);
}
}
@edinsoncs
edinsoncs / gist:a979509823bc390b3bf8
Created March 20, 2016 02:18 — forked from lerouxb/gist:1071705
A little node.js server for testing html5 ajax file uploads.
/*
A little node.js server for testing html5 ajax file uploads.
It serves up the current directory and receives uploads at /upload.
This is for use with xhr.send(file) where the entire request body is the file.
It just pauses one second between chunks so that client-side progress events
get a chance to fire. On my laptop it looks like the maximum chunk size is
around 40K, so you would still need images in the range of hundreds of kilobytes
to really be able to test it.
@edinsoncs
edinsoncs / Menu Animation
Last active April 1, 2016 15:52
Menu Animation
Javascript
function menu(){
function selectItemClick(item){
return item;
}
function showItemMenu(item){
return item;