Skip to content

Instantly share code, notes, and snippets.

⌨️
coding

Emanuele DelBono emadb

⌨️
coding
Block or report user

Report or block emadb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fizzbuzz.cs
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"},
@emadb
emadb / fizz_buzz.exs
Last active Aug 8, 2019
FizzBuzz in Elixir using only functions: no numbers, no strings, no loops and no ifs!
View fizz_buzz.exs
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))
@emadb
emadb / DynamicBinderExtensions.cs
Last active Aug 16, 2018 — forked from thecodejunkie/DynamicModelBinder.cs
A DynamicModelBinder for NancyFx (http://nancyfx.org/). It convert your request data (form, body, querystring) into a dynamic model. This means that you don't have to create all your useless DTO. NOTE. The original version is here https://gist.github.com/thecodejunkie/5521941 (thecodejunkie). I simply add the support for deserialize the request …
View DynamicBinderExtensions.cs
public static class DynamicBinderExtensions
{
public static dynamic DynaBind(this INancyModule module)
{
return module.Bind<DynamicDictionary>();
}
}
@emadb
emadb / Dispatcher.js
Last active Oct 10, 2017
medium - react and redux
View Dispatcher.js
const dispatcher = {
subscribers: [],
register(subscriber) {
this.subscribers.push(subscriber)
},
dispatch(action) {
this.subscribers.forEach(s => s(action))
}
}
View gist:9d6adbeaeb8f924f9a07b86f7269929e
### 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:
View gist:906a5fee800480e079f2
/*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');
@emadb
emadb / eslint.config.js
Last active Oct 28, 2016
My Eslint configuration
View eslint.config.js
{"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
@emadb
emadb / index.html
Last active Sep 15, 2016
JS Bin - Reactjs bootstrap modal example // source http://jsbin.com/gucuvu/6/edit?html,js,output
View index.html
<!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">
@emadb
emadb / SublimeText_shortcuts.md
Created May 20, 2016
Sublime Text Shorcuts
View SublimeText_shortcuts.md

##Text Editing

  • Insert line before - Cmd + Shift + Return
  • Insert line after - Cmd + Return
  • Delete the word backward - Option + Delete
  • Delete the word forward - fn + Option + Delete
  • Delete to beginning of the line - Cmd + Delete
  • Delete to end of the line - Ctrl + K
  • Delete word back - Option + Delete
  • Delete word forward - fn + Option + Delete
  • Soft undo - Cmd + U
View gist:8ef2832f83e6bd62cfa1
Verifying that +emanueledelbono is my blockchain ID. https://onename.com/emanueledelbono
You can’t perform that action at this time.