Skip to content

Instantly share code, notes, and snippets.

// Global jasmine hook to prevent errors when attempt to
// download a localization .json file in test environment.
// Here we are resetting the translate provider to a
// safe state.
// If a test needs to assert for localized texts,
// the test author is free to setup the translate provider
// on isolation by overriding its settings.
// This wont affect other tests because once the test execution
// exits, the translate provider is reset once again to
// a safe state.
// Builders
class SimpleBuilder {
constructor(private current = {}) {
}
prop(key: string, value: any) {
return new SimpleBuilder({ ...this.current, ...{ [key]: value } });
}
@emiaj
emiaj / curry.ts
Created August 17, 2018 12:44
Curry
declare type Curry<P, V> =
P extends [infer A, infer B, infer C, infer D] ? (a: A) => Curry<[B, C, D], V> :
P extends [infer A, infer B, infer C] ? (a: A) => Curry<[B, C], V> :
P extends [infer A, infer B] ? (a: A) => Curry<[B], V> :
P extends [infer A] ? (a: A) => V :
() => V; // could be unknow, but this allows to safely pass parameterless functions
declare function curry<T extends any[], R>(fn: (...args: T) => R): Curry<T, R>;
(function ($) {
$.fubuvalidation.Processor.findElementsWith(function(context) {
var element = $("#" + context.key, context.form);
if (element.size() == 0) {
return;
}
context.element = element;
});
$.fubuvalidation.Processor.findElementsWith(function(context) {
var element = $("[name=" + context.key + "]", context.form);
using System;
using System.Collections.Generic;
using FubuCore.Reflection;
using FubuMVC.Core.UI.Configuration;
using HtmlTags;
using MyProject.Core.Infrastructure.Extensions;
namespace MyProject.Core.Infrastructure.Fubu.HtmlConventions
{
public class EnumRadioButtonListEditor : ElementBuilder
@emiaj
emiaj / app.html
Last active May 21, 2016 05:37 — forked from charlespockert/add-suffix.js
Base Aurelia Gist
<template>
<require from="nav-bar.html"></require>
<require from="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"></require>
<nav-bar router.bind="router"></nav-bar>
<div class="page-host" style="margin-top:50px">
<router-view></router-view>
</div>
</template>
app.directive 'enterKey', ($timeout) ->
(scope, elem, attrs) ->
elem.bind 'keydown', (e) ->
if e.keyCode is 13
$timeout ->
scope.$apply attrs.enterKey
, +attrs.enterKeyDelay
object HelloFuturesScala extends App {
import scala.concurrent._
import scala.concurrent.duration._
import ExecutionContext.Implicits.global
def identityFunction(number:Int) = {
Thread.sleep(3000)
number
}
println("Hello Futures Scala")
Gtk-Message: Failed to load module "overlay-scrollbar"
`menu_proxy_module_load': skype-bin: undefined symbol: menu_proxy_module_load
(skype-bin:18177): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': skype-bin: undefined symbol: menu_proxy_module_load
(skype-bin:18177): Gtk-WARNING **: Failed to load type module: (null)
`menu_proxy_module_load': skype-bin: undefined symbol: menu_proxy_module_load
Your overall score for this assignment is 9.58 out of 10.00
The code you submitted did not pass all of our tests: your submission achieved a score of
7.58 out of 8.00 in our tests.
In order to find bugs in your code, we advise to perform the following steps:
- Take a close look at the test output that you can find below: it should point you to
the part of your code that has bugs.
- Run the tests that we provide with the handout on your code.
- The tests we provide do not test your code in depth: they are very incomplete. In order