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.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace ConsoleApplication1 | |
{ | |
class 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
Consider to have a series of calculators functions that need to run in series. | |
These calculators are asynchronous and any of those can return a value (a number >=0) or an error (-1). | |
Calculators must be evaluated in order and you have to write a function that returns the value of the first calculator | |
that doesn't fail. For first I mean the first in the chain of calculators. | |
Test case | |
function calculator1(resultCallback){ | |
setTimeout(function(){ resultCallback(-1) }, 1000); | |
} |
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 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 |
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
Show hidden characters
[ | |
//======================================================== | |
// TABS (REGULAR) | |
//-------------------------------------------------------- | |
// Tab set | |
{ | |
"class": "tabset_control", | |
"layer0.texture": "Seti_UI/Main/tabset-background.png", | |
"layer0.inner_margin": [1, 7], | |
"layer0.opacity": 1, |
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"> |
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
var obj1 = { | |
foo: function(){ | |
obj2.bar(this.obj1Callback); | |
}, | |
obj1Callback: function(){ | |
// do something | |
} | |
}; | |
var obj2 = { |
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
window.app = angular.module('myApp', []); | |
window.app.controller('mainController', function($scope){ | |
$scope.title = "Demo"; | |
$('#btn').click(function(){ | |
console.log('Controller: click'); | |
}); | |
}); |
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
function MyObject(fun){ | |
this.fun = fun; | |
} | |
MyObject.prototype.doSomething = function() { | |
this.fun(); | |
}; | |
var f = function (){console.log('Original function')}; |
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
module.exports = (function() { | |
var fizzFun = function(n){ | |
if (n % 3 == 0) | |
return 'fizz'; | |
}; | |
var buzzFun = function(n){ | |
if (n % 5 == 0) | |
return 'buzz'; |