Skip to content

Instantly share code, notes, and snippets.


Vojta Jina vojtajina

  • San Francisco Bay Area
View GitHub Profile
vojtajina / checkbox-input-widget.html
Created Feb 8, 2014
Angular templating proposal examples
View checkbox-input-widget.html
<div class="fancy_checkbox">
<div class="box {{checked}}"></div>
View file-component.html
<i class="file {{data.extension}}" on-click="emitClick()">
<span class="folder-name">{{data.basename}}</span>
vojtajina / spec-one.js
Created Feb 21, 2014
Code example for Merrick.
View spec-one.js
it('should call append', inject($, MyUI, function(jQuery, ui) {
spyOn(jQuery, 'append');
View inject-helper.js
// helper function, we can even ship these
define(['di/annotations'], function(annotations) {
var Inject = annotations.Inject;
var annotate = annotations.annotate;
return function inject(fn) {
var deps =, 1);
var annotation = new Inject();
Inject.apply(annotation, deps);
vojtajina / di-simple-config.js
Created Apr 21, 2014
One possible way of doing configuration with DI. I think we need something nicer...
View di-simple-config.js
function Config() {
this.useFoo = false;
this.log = 'infoo;
class SomeService{
constructor(config) {
// ...
vojtajina / example.js
Created May 10, 2014
An example of Node core module bindings for DI.
View example.js
import {module as nodeBindings} from './node_bindings';
import {Injector} from 'di';
import {Foo} from './foo';
var injector = new Injector(nodeBindings);
var foo = injector.get(Foo);
vojtajina / foo.js
Last active Aug 29, 2015
Tracuer with es6-module-loader and systemjs
View foo.js
// Transpiled by
// ./node_modules/traceur/traceur --modules=instantiate
System.register("foo", [], function($__export) {
"use strict";
var __moduleName = "foo";
return {
setters: [],
execute: function() {
View types_playground.dart
class Car {
start() {}
class Mustang extends Car {
startGasEngine() {
print('Starting gas engine.');
openWindow() {}
View annotations.js
// Annotations can be put on:
// - functions / classes
// - function parameters
function foo(@Baz() param1, @Baz() param2: Foo) {}
function foo() {}
// Using property getters, so that it works with circular references.
View angular-bug-01.html
<html xmlns:ng="">
<script type="text/javascript" src="../angular.js/src/angular-bootstrap.js" ng:autobind></script>
<script type="text/javascript">
angular.markup('---', function(text, textNode, parentElement) {
var compiler = this;