Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Working from home

Julian David juliandavidmr

:octocat:
Working from home
View GitHub Profile
@juliandavidmr
juliandavidmr / Crear.cshtml
Created Jan 8, 2017
Mostrar Select (html) con datos a partir de un DataTable en C# & Razor
View Crear.cshtml
<div class="">
@Html.LabelFor(model => model.griv_idgrupoinv, htmlAttributes: new { @class = "" })
@Html.DropDownList("griv_idgrupoinv", new SelectList(ViewBag.GrupoInv, "Text", "Value"), new { @class = "form-control" })
</div>
@juliandavidmr
juliandavidmr / server.js
Created Jan 31, 2017
Servidor básico de NodeJS. Sin ExpressJS
View server.js
var mysql = require('mysql');
var connection = mysql.createConnection({
host: 'localhost',
user: 'root',
password: 'root',
database: 'personas',
port: 3306
});
View cli.js
#!/usr/bin/env node
'use strict';
var meow = require('meow');
var catNames = require('./');
var cli = meow([
'Examples',
' $ cat-names',
' Max',
View index.js
'use strict';
var uniqueRandomArray = require('unique-random-array');
var catNames = require('./cat-names.json');
exports.all = catNames;
exports.random = uniqueRandomArray(catNames);
View package.json
{
"name": "cat-names",
"version": "1.0.0",
"description": "Get popular cat names",
"license": "MIT",
"repository": "sindresorhus/cat-names",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
View cat-names.json
[
"Abby",
"Angel",
"Annie",
"Baby",
"Bailey",
"Bandit",
"Bear",
"Bella",
"Bob",
View readme.md

Get popular cat names

Install

$ npm install --save cat-names

Usage

View index.js
function (a, b) {
return a + b;
}
@juliandavidmr
juliandavidmr / HomeController.cs
Created Feb 17, 2017
Implementacion de API OAuth Chaira en MVC Razor C#. Iniciar sesión y obtener información basica del usuario logeado.
View HomeController.cs
using System.Web.Mvc;
using Helpers;
using System.Web.Security;
namespace Project.Controllers {
[AllowAnonymous]
public class HomeController : Controller {
[HttpGet]
@juliandavidmr
juliandavidmr / stop_iis_windows.bash
Created Oct 8, 2017
Start or Stop the Web Server (IIS 7)
View stop_iis_windows.bash
# Stop
net stop WAS
# Start
# net start W3SVC