Skip to content

Instantly share code, notes, and snippets.

View dearcodes's full-sized avatar
🏄‍♂️

Daniel Reyes dearcodes

🏄‍♂️
View GitHub Profile
@dearcodes
dearcodes / uploadFileToAzureBlobStorage.js
Created August 26, 2015 03:31
Creates a file in Azure Blob Storage using multiplarty and azure-storage packages.
import express from 'express';
import multiparty from 'multiparty';
import mongoose from 'mongoose';
var router = express.Router();
router.post('/uploadCourseImage', uploadFileToBlob);
function uploadFileToBlob(req, res) {
var accessKey = '';
var storageAccount = 'afiliadosricos';
var blobService = azure.createBlobService(storageAccount, accessKey);
@dearcodes
dearcodes / javascript_resources.md
Last active August 29, 2015 14:08 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@dearcodes
dearcodes / 0_reuse_code.js
Last active August 29, 2015 14:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@dearcodes
dearcodes / index.cshtml
Created September 12, 2014 20:39
ejemplo grilla con detalle
@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.EmployeeViewModel>()
.Name("grid")
.Columns(columns =>
{
columns.Bound(e => e.FirstName).Width(120);
columns.Bound(e => e.LastName).Width(120);
columns.Bound(e => e.Country).Width(120);
columns.Bound(e => e.City).Width(120);
columns.Bound(e => e.Title);
})
@dearcodes
dearcodes / iff
Last active August 29, 2015 14:06
If con varias condiciones
if (new[] {1, 2}.Contains(value))
//OR
public static bool In<T>(this T obj, params T[] args)
{
return args.Contains(obj);
}
@dearcodes
dearcodes / Index.cshtml
Last active August 29, 2015 14:06
Ejemplo de como obtener la propiedad de un row activo
@model object
@(Html.Kendo().DropDownListFor(m => m)
.DataValueField("ListStatusId")
.DataTextField("ListStatusName")
.DataSource(d =>
//get the additional data using function in the main view
d.Read(r => r.Action("GetStatusList", "Home").Data("getParentID()"))
)
@dearcodes
dearcodes / gist:95d1d51a3638b867d09b
Created August 21, 2014 19:29
Grid con operaciones serverside
@model IEnumerable<Inka.Models.Entities.###MODELO###>
@{
Layout = "~/Features/Shared/_Layout.cshtml";
}
@(Html.Kendo().Grid(Model)
.Name("Grid")
.Columns(columns =>
{