Skip to content

Instantly share code, notes, and snippets.

@alexeygolev
alexeygolev / build.js
Created September 27, 2012 02:56 — forked from millermedeiros/build.js
sample node.js build script including RequireJS optimizer (r.js) and copy/delete/filter files
var _cli = require('commander'),
_minimatch = require('minimatch'),
_wrench = require('wrench'),
_fs = require('fs'),
_path = require('path'),
_requirejs = require('requirejs');
// ========
@alexeygolev
alexeygolev / gist:3785312
Created September 26, 2012 00:38 — forked from Mithrandir0x/gist:3639232
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@alexeygolev
alexeygolev / gist:3739247
Created September 17, 2012 19:24 — forked from gregorymostizky/gist:2892352
PlayerV3 - Message Bus Usage Example
<html>
<head>
<!-- Load Ooyala Player -->
<script src='http://player.ooyala.com/v3/replace_with_player_branding_id'></script>
</head>
<body>
<!-- Player Placement -->
@alexeygolev
alexeygolev / coffeeStrings
Created August 16, 2012 02:40
optional text in coffeescript strings
$scope.hello = (name)->
alert "hello #{(name || 'world')}!"
@alexeygolev
alexeygolev / controllerSpec.coffee
Created August 14, 2012 02:13
angular.js jasmine test spec for controller defined inside a module in coffeescript
'use strict'
#jasmine specs for controllers go here
describe 'PhoneCat controllers', ->
describe 'PhoneListCtrl', ->
beforeEach module 'phonesCat.controllers'
@alexeygolev
alexeygolev / controllersSpec.js
Created August 14, 2012 01:47
angular.js jasmine test spec for controller defined inside a module
'use strict';
/* jasmine specs for controllers go here */
describe('PhoneCat controllers', function() {
describe('PhoneListCtrl', function() {
beforeEach(module('phonesCat.controllers'));
@alexeygolev
alexeygolev / config.js
Created August 14, 2012 00:43
angular - seed testacular config.js
// Sample Testacular configuration file, that contain pretty much all the available options
// It's used for running client tests on Travis (http://travis-ci.org/#!/vojtajina/testacular)
// Most of the options can be overriden by cli arguments (see testacular --help)
// base path, that will be used to resolve files and exclude
basePath = ''
// list of files / patterns to load in the browser