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
Setup | |
----- | |
How to undo (almost) anything with Git | |
https://github.com/blog/2019-how-to-undo-almost-anything-with-git | |
git clone <repo> | |
clone the repository specified by <repo>; this is similar to "checkout" in | |
some other version control systems such as Subversion and CVS |
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 deepDiffMapper = function() { | |
return { | |
VALUE_CREATED: 'created', | |
VALUE_UPDATED: 'updated', | |
VALUE_DELETED: 'deleted', | |
VALUE_UNCHANGED: 'unchanged', | |
map: function(obj1, obj2) { | |
if (this.isFunction(obj1) || this.isFunction(obj2)) { | |
throw 'Invalid argument. Function given, object expected.'; | |
} |
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
it('should get all the keys of an object', function() { | |
var selectedTile = { $$hashKey: 'testId', obj1:'test', obj2:5, obj3:{ test1:'test',test2:{a:1,b:2} } }; | |
var selectedTile2 = { $$hashKey: 'testId', obj1:'test', obj2:5, obj3:{ test1:'test' } }; | |
var keyList = []; | |
var recursiveEach = function(obj, customFunc) { | |
// using recursive each because _.each/_.keys only gets first level properties | |
for (var k in obj) { | |
if (typeof obj[k] == "object" && obj[k] !== null){ | |
customFunc(k); |
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
// app.js | |
// http://djds4rce.wordpress.com/2013/08/13/understanding-angular-http-interceptors/ | |
// http://blog.brunoscopelliti.com/http-response-interceptors | |
//any 404 error clean cookies and sends the user to login | |
var interceptor = ['$rootScope', '$q', '$location', '$cookieStore', function ($rootScope, $q, $location, $cookieStore) { | |
function success(response) { |
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
// verify you are not injecting 'ngMockE2E' for mock backend when working on unit tests | |
// and delete/comment mock backend stuff | |
// use httpBackend.flush() with $resource http://davidjs.com/2013/09/tricky-unit-testing-of-httpbackend/ | |
// http://blogs.burnsidedigital.com/2013/09/and-httpbackend-mock-for-all-unit-e2e-testings/ | |
describe( 'AppCtrl', function() { | |
describe( 'isCurrentUrl', function() { | |
var AppCtrl, $location, $scope; | |
var httpBackend; |
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
<h3 class='post-title entry-title'> | |
<a href='http://www.nielskrijger.com/2013/08/rest-and-json-api-guidelines-and-best.html'>REST and JSON best practices</a> | |
</h3> | |
<div class='post-header'> | |
<div class='post-header-line-1'> | |
</div> | |
</div> | |
<div class='post-body entry-content'> |
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
{ | |
"name": "fsog", | |
"version": "0.0.1", | |
"devDependencies": { | |
"angular": "~1.2.15", | |
"angular-mocks": "~1.0.7", | |
"bootstrap": "~3.0.3", | |
"angular-bootstrap": "~0.10.0", | |
"angular-ui-router": "~0.0.1", | |
"angular-ui-utils": "~0.0.3", |
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
# ExampleSnippets.txt | |
---------------------------------------------------------- | |
********************* | |
CHAPTER 2: | |
********************* | |
--- HelloWorld --- |