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
@emadb
emadb / Comp.ex
Last active Aug 29, 2015
Comp.ex
View Comp.ex
defmodule Comp do
def check([h|t], b) do
check(t, List.delete(b, h*h))
end
def check(_,[]), do: true
def check([], b), do: false
end
View Seti_modified.sublime-theme
[
//========================================================
// TABS (REGULAR)
//--------------------------------------------------------
// Tab set
{
"class": "tabset_control",
"layer0.texture": "Seti_UI/Main/tabset-background.png",
"layer0.inner_margin": [1, 7],
"layer0.opacity": 1,
@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">
View gist:924b2a9f28e8fb3c6c2d
var obj1 = {
foo: function(){
obj2.bar(this.obj1Callback);
},
obj1Callback: function(){
// do something
}
};
var obj2 = {
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 / app.js
Last active Aug 29, 2015
Angular directive rendering.
View app.js
window.app = angular.module('myApp', []);
window.app.controller('mainController', function($scope){
$scope.title = "Demo";
$('#btn').click(function(){
console.log('Controller: click');
});
});
@emadb
emadb / gist:1354b4fa365997746168
Created Oct 28, 2014
Spot the bug! Why doesn't doSomething print "new function"
View gist:1354b4fa365997746168
function MyObject(fun){
this.fun = fun;
}
MyObject.prototype.doSomething = function() {
this.fun();
};
var f = function (){console.log('Original function')};
View fizzbuzz.js
module.exports = (function() {
var fizzFun = function(n){
if (n % 3 == 0)
return 'fizz';
};
var buzzFun = function(n){
if (n % 5 == 0)
return 'buzz';
@emadb
emadb / gist:38cf4c94ac858382300c
Created Jun 16, 2014
Javascript refactoring
View gist:38cf4c94ac858382300c
function mouseup(evt) {
if (_isDD) {
return;
}
if (evt.shiftKey == true) {
var indexOf1 = this.cont.list.indexOf(_lastItemSelected);
var indexOf2 = this.cont.list.indexOf(this);
for (var i = indexOf2; i > indexOf1; i--) {
var item = this.cont.list[i];
View berlin_clock.rb
class BerlinClock
SECONDS = "Y"
HOURS_FIVES = "RRRR"
HOURS_ONES = "RRRR"
MINUTES_FIVES = "YYRYYRYYRYY"
MINUTES_ONES = "YYYY"
def initialize(h,m,s)
@h, @m, @s = h, m, s
end
You can’t perform that action at this time.