This file contains hidden or 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
import {Container} from "aurelia-framework"; | |
import {CacheService, CACHE_STORE} from "./cache"; | |
describe("The Cache Service", () => { | |
let cacheManager: CacheService; | |
beforeEach(() => { | |
cacheManager = new Container().get(CacheService); | |
}); |
This file contains hidden or 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
$('a').click(function(ev){ | |
href = this.href.replace(window.location.href,''); | |
if ( href[0] != '#' || !$(href) ) { | |
return; | |
} | |
$('html, body').animate({ scrollTop: $(href).offset().top }, 500); | |
ev.stopPropagation(); | |
return false; | |
}); |
This file contains hidden or 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
/** | |
* @see https://github.com/domenic/promises-unwrapping/blob/master/docs/states-and-fates.md | |
*/ | |
export class Deferred<T> { | |
public promise: Promise<T>; | |
private fate: "resolved" | "unresolved"; | |
private state: "pending" | "fulfilled" | "rejected"; | |
private _resolve: Function; |
This file contains hidden or 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
alias ttime_green="sh -c \"sleep 180 && notify-send -u critical 'The tea is ready'\" &" | |
alias ttime_black="sh -c \"sleep 300 && notify-send -u critical 'The tea is ready'\" &" |
This file contains hidden or 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
sudo dpkg --add-architecture i386 | |
sudo apt-get update | |
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libidn11:i386 libgssapi-krb5-2:i386 |
This file contains hidden or 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 es = require('event-stream'); | |
var fs = require('fs'); | |
var mkdirp = Promise.denodeify(require('mkdirp')); | |
var path = require('path'); | |
var plumber = require('gulp-plumber'); | |
var Promise = require('promise'); | |
var ts = require('typescript'); | |
var typescript = require('gulp-typescript'); | |
var paths = { |
This file contains hidden or 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
export function translation(textkey: string) { | |
if (!textkey) { | |
throw "Parameter textkey is required with the @translation decorator"; | |
} | |
return (target: any, property: string) => { | |
translationService().getTranslation(textkey) | |
.then(text => target[property] = text); | |
} | |
} |
This file contains hidden or 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
@Singleton | |
public class FrontendTextBean { | |
@EJB | |
private TextCache textCache; | |
private Set<String> textkeys = new HashSet<>(); | |
@PostConstruct | |
public void init() { |
This file contains hidden or 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
export const enum KeyCode { | |
ENTER = 13, | |
SPACE = 32 | |
} | |
export function keyListener(keyCodes: KeyCode | KeyCode[]) { | |
if (!(keyCodes instanceof Array)) { | |
keyCodes = [keyCodes]; | |
} |