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
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"
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@jrgcubano
jrgcubano / boot.js
Created June 27, 2014 17:42 — forked from jdx/boot.js
// This script will boot app.js with the number of workers
// specified in WORKER_COUNT.
//
// The master will respond to SIGHUP, which will trigger
// restarting all the workers and reloading the app.
var cluster = require('cluster');
var workerCount = process.env.WORKER_COUNT || 2;
// Defines what each worker needs to run