Skip to content

Instantly share code, notes, and snippets.

View jrgcubano's full-sized avatar

Jorge Rodríguez Galán jrgcubano

View GitHub Profile
[IPFilter("192.168.0.0/24")]
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
}
module.exports = function(grunt) {
grunt.initConfig({
/*
copy header-template.html which will have placeholders for injecting css,js
*/
copy: {
main: {
files: [
namespace Sagas
{
using System;
using System.Collections.Generic;
class Program
{
static ActivityHost[] processes;
@jrgcubano
jrgcubano / 1.cs
Created February 10, 2014 08:40 — forked from cuppster/1.cs
/*
modified from original source: https://bitbucket.org/mattkotsenas/c-promises/overview
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Promises
public class ExpressionBuilder
{
// Define some of our default filtering options
private static MethodInfo containsMethod = typeof(string).GetMethod("Contains", new[] { typeof(string) });
private static MethodInfo startsWithMethod = typeof(string).GetMethod("StartsWith", new[] { typeof(string) });
private static MethodInfo endsWithMethod = typeof(string).GetMethod("EndsWith", new[] { typeof(string) });
public static Expression<Func<T, bool>> GetExpression<T>(List<GridHelper.Filter> filters)
{
// No filters passed in #KickIT
@jrgcubano
jrgcubano / gist:04526ee496f80116d64d
Created May 7, 2014 07:55
Guard C# Provides utility methods to guard parameter and local variables.
/// <summary>
/// Provides utility methods to guard parameter and local variables.
/// </summary>
public class Guard
{
/// <summary>
/// Throws an exception of type <typeparamref name="TException"/> with the specified message
/// when the assertion statement is true.
/// </summary>
/// <typeparam name="TException">The type of exception to throw.</typeparam>
public abstract class CrudRepository<TEntity>:CrudRepository<TEntity,Guid>,ICrudRepository<TEntity>
{
}
public abstract class CrudRepository<TEntity,TId>: ICrudRepository<TEntity,TId>
{
#region properties
public abstract IQueryable<TEntity> RepositoryQuery { get; }
#endregion
applicationsService.getApplications().then(function (response) {
$scope.applications = response.data;
}).catch(function (data) {
$scope.applications = null;
})['finally'](function () {
$scope.isBusy = false;
});
"use strict";
(function (app) {
var selectApplicationController = function ($scope,applicationsService) {
$scope.name = "Step 1 - Specify application";
$scope.application={};
applicationsService.getApplications()
.then(function (response) {
$scope.applications = response.data;
git_version() {
git --version | sed -e 's/.*\([0-9].[0-9].[0-9]\)/\1/'
}
if [ -f "/usr/local/Cellar/git/$(git_version)/etc/bash_completion.d/git-completion.bash" ]; then
. "/usr/local/Cellar/git/$(git_version)/etc/bash_completion.d/git-completion.bash"
fi
if [ -f "/usr/local/Cellar/git/$(git_version)/etc/bash_completion.d/git-prompt.sh" ]; then
. "/usr/local/Cellar/git/$(git_version)/etc/bash_completion.d/git-prompt.sh"