This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Controller HTTP | |
public class Controller | |
{ | |
public UserResponse Post(UserRequest req) | |
{ | |
User user = createUserValidator.Validate(req); | |
// Fino a qui sono nel contesto HTTP | |
// Qui entro nel dominio. Forse sarebbe meglio usare un gateway per accedere al dominio | |
// ma dipende dal tipo di applicazione. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Foo do | |
def execute_command(data, coeff) do | |
data = prepare_data(data, coeff) | |
persist(data.name, coeff) | |
end | |
def prepare_data(data, coeff) do | |
w = calculate_w(data.x, data.y, data.z, coeff) | |
%{ | |
name: "foo", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Collections.Generic; | |
namespace CodicePlastico | |
{ | |
public class FizzBuzz | |
{ | |
private static readonly IDictionary<int, string> _cases = new Dictionary<int, string> | |
{ | |
{3, "fizz"}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Church do | |
def fizzbuzz do | |
(fn k -> fn f -> ((fn f -> (fn x -> f.(fn y -> x.(x).(y) end) end).(fn x -> f.(fn y -> x.(x).(y) end) end) end).( | |
fn f -> fn l -> fn x -> fn g -> | |
(fn b -> b end).((fn p -> p.(fn a -> fn b -> a end end) end).(l)).(x).(fn y -> g.(f.((fn l -> (fn p -> p.(fn a -> fn b -> b end end) end) | |
.((fn p -> p.(fn a -> fn b -> b end end) end).(l)) end).(l)).(x).(g)).((fn l -> (fn p -> p.(fn a -> fn b -> a end end) end) | |
.((fn p -> p.(fn a -> fn b -> b end end) end).(l)) end).(l)).(y) end) | |
end end end end | |
)).(k).((fn x -> fn y -> fn f -> f.(x).(y) end end end).(fn x -> (fn y -> x end) end).(fn x -> (fn y -> y end) end)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class DynamicBinderExtensions | |
{ | |
public static dynamic DynaBind(this INancyModule module) | |
{ | |
return module.Bind<DynamicDictionary>(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dispatcher = { | |
subscribers: [], | |
register(subscriber) { | |
this.subscribers.push(subscriber) | |
}, | |
dispatch(action) { | |
this.subscribers.forEach(s => s(action)) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am emadb on github. | |
* I am emadb (https://keybase.io/emadb) on keybase. | |
* I have a public key whose fingerprint is 8F39 3A1D 85DC 83C7 B8C8 BDDE B295 AE38 057C 4B76 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint node: true */ | |
"use strict"; | |
module.exports = function (grunt) { | |
grunt.loadNpmTasks('grunt-msbuild'); | |
grunt.loadNpmTasks('grunt-aspnet-server'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-iisexpress'); | |
grunt.loadNpmTasks('grunt-contrib-compass'); | |
grunt.loadNpmTasks('grunt-contrib-jshint'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"rules": { | |
// https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb | |
/* best practices */ | |
"accessor-pairs": 0, | |
// enforces return statements in callbacks of array's methods | |
// http://eslint.org/docs/rules/array-callback-return | |
"array-callback-return": 2, | |
// treat var statements as if they were block scoped | |
"block-scoped-var": 2, | |
// specify the maximum cyclomatic complexity allowed in a program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="Reactjs bootstrap modal example"> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.1/JSXTransformer.js"></script> | |
<script src="http://code.jquery.com/jquery.min.js"></script> | |
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> | |
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script> | |
<script src="http://fb.me/react-with-addons-0.12.2.js"></script> | |
<meta charset="utf-8"> |
NewerOlder