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
if (action.isArray) { | |
if (!angular.isArray(data)) { | |
throw $resourceMinErr('badcfg', 'Error in resource configuration. Expected response to contain an array but got an object'); | |
} | |
value.length = 0; | |
forEach(data, function(item) { | |
value.push(new Resource(item)); | |
}); | |
} else { |
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
// DSL - these migt be provided by protractor | |
// `protractor` is globally provided instance of Provider (connected webdriver instance) | |
// `protractor.driver` can be the wrapper webdriver instance | |
var navigateTo = protractor.get; | |
var element = protractor.getElementByCssSelector; | |
var button = function(label) { | |
return protractor.getElementByCssSelector(':button:contains("' + label + '")'); | |
}; | |
// We should provide some syntactic sugar for defining custom helpers. |
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
##teamcity[enteredTheMatrix] | |
##teamcity[testSuiteStarted nodeId='1' parentNodeId='0' name='karma.conf.js' nodeType='config' locationHint='config:///Users/vojta/Code/angular.dart/karma.conf.js'] | |
##teamcity[testSuiteStarted nodeId='2' parentNodeId='1' name='Chrome 29.0.1530 (Mac OS X 10.8.4)' nodeType='browser'] | |
##teamcity[testCount count='307'] | |
##teamcity[testStarted nodeId='3' parentNodeId='2' name='MockHttp should replay an http request' nodeType='test' locationHint='test://MockHttp should replay an http request'] | |
##teamcity[testFinished nodeId='3' duration='5'] | |
##teamcity[testStarted nodeId='4' parentNodeId='2' name='MockHttp should replay an http request which is expected multiple times' nodeType='test' locationHint='test://MockHttp should replay an http request which is expected multiple times'] | |
##teamcity[testFinished nodeId='4' duration='1'] | |
##teamcity[testStarted nodeId='5' parentNodeId='2' name='MockHttp should throw an exeception on assertAllGetsCalled when not all expected GETs were called' nodeType |
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
// This is my TEST... | |
describe('angularjs homepage', function() { | |
beforeEach(function() { | |
navigateTo('http://angularjs.org/'); | |
}); | |
it('should greet', function() { | |
// any css selector | |
element('input[ng-model=yourName]').sendKeys('Julie'); |
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
val sqlContext = new org.apache.spark.sql.SQLContext(sc) | |
val testresults = sqlContext.read.json("/Users/vojta/Code/test.json") | |
testresults.registerTempTable("testresults") | |
testresults.printSchema() | |
// Output: | |
// sqlContext: org.apache.spark.sql.SQLContext = org.apache.spark.sql.SQLContext@5c927efe | |
// testresults: org.apache.spark.sql.DataFrame = [build: string, date: string, finished_epoch: double, first_failed_test_category: string, first_failed_test_error_string: string, first_failed_test_id: string, model: string, result_finished: string, result_started: string, root_test_category: string, root_test_id: string, status: string, tags: struct<mail_failure:boolean,product_failure:boolean,spotlight_failure:boolean,suggestd_failure:boolean>, train: string, uuid: string] | |
// root | |
// |-- build: string (nullable = true) |
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
# fetching a single pull request from github | |
# put it into ~/.profile or ~/.bashrc | |
function fetch_pr() { | |
PR=$1 | |
BRANCH=$2 | |
if [ -z $PR ]; then | |
echo "Missing pull request number" | |
return 1 | |
fi |
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 async = require('async'); | |
var fs = require('fs'); | |
var files = []; | |
while(files.length < 100000) { | |
files.push('/some/file' + files.length); | |
} |
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
{ | |
"auto_complete_commit_on_tab": true, | |
"close_windows_when_empty": true, | |
"color_scheme": "Packages/User/Monokai Vojta.tmTheme", | |
"ensure_newline_at_eof_on_save": true, | |
"font_size": 12.0, | |
"highlight_line": true, | |
"hot_exit": false, | |
"ignored_packages": | |
[ |
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
#!/bin/sh | |
# Shell script to start Sublime | |
# @author Vojta Jina <vojta.jina@gmail.com> | |
if [ -z $@ ]; then | |
# no arguments, try to find project | |
# TODO(vojta): traverse up to find projects in parent directories | |
PROJECT=`ls *.sublime-project 2>/dev/null` |
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(grunt) { | |
grunt.initConfig({ | |
inline: { | |
'index.html': ['tpl/*.html'] | |
} | |
}); | |
grunt.registerMultiTask('inline', 'Inline AngularJS templates into single file.', function() { | |
var SCRIPT = '<script type="text/ng-template" id="<%= id %>"><%= content %></script>\n'; |