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
{ | |
"bold_folder_labels": true, | |
"caret_style": "phase", | |
"color_scheme": "Packages/Dayle Rees Color Schemes/sublime/hyrule.tmTheme", | |
"draw_white_space": "all", | |
"fade_fold_buttons": false, | |
"font_face": "Inconsolata", | |
"font_size": 14.0, | |
"highlight_line": true, | |
"highlight_modified_tabs": 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
[user] | |
name = Jaime González García | |
email = someemail@company.com | |
[alias] | |
st = status | |
ci = commit | |
co = checkout | |
lo = log | |
br = branch | |
lol = log --graph --decorate --pretty=oneline --abbrev-commit --all |
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
[Test] | |
public void $methodName$_When$context$_Should$expectedResult$() | |
{ | |
// Arrange | |
$END$ | |
// Act | |
// Assert | |
} |
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
public static class ModelStateTestHelpers | |
{ | |
public static bool HasError(this ModelStateDictionary modelState, string errorMessage) | |
{ | |
return modelState.Any(ms => ms.Value.Errors.Any(e => e.ErrorMessage == errorMessage)); | |
} | |
} |
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
public static class ModelStateTestHelpers | |
{ | |
public static bool HasError(this ModelStateDictionary modelState, string errorMessage) | |
{ | |
return modelState.Any(ms => ms.Value.Errors.Any(e => e.ErrorMessage == errorMessage)); | |
} | |
} |
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
/* | |
* $description$ directive. | |
* | |
* Usage: | |
* <vtf-$directiveName$></vtf-$directiveName$> | |
* | |
*/ | |
(function () { | |
'use strict'; |
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
// spec/observableBehaviors.js | |
it('Should notify subscribers of a change when an object value is written, even if it is identical to the old value', function() { | |
// Because we can't tell whether something further down the object graph has changed, we regard | |
// all objects as new values. To override this, set an "equalityComparer" callback | |
var constantObject = {}; | |
var instance = new ko.observable(constantObject); | |
var notifiedValues = []; | |
instance.subscribe(notifiedValues.push, notifiedValues); | |
instance(constantObject); | |
expect(notifiedValues).toEqual([constantObject]); |
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
// src/subscribables/subscribable.js | |
"notifySubscribers": function (valueToNotify, event) { | |
event = event || defaultEvent; | |
if (this._subscriptions[event]) { | |
ko.dependencyDetection.ignore(function() { | |
ko.utils.arrayForEach(this._subscriptions[event].slice(0), function (subscription) { | |
// In case a subscription was disposed during the arrayForEach cycle, check | |
// for isDisposed on each subscription before invoking its callback |
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
/* | |
* | |
* Memoizes call to a service using a promise | |
* | |
*/ | |
function memoizeWithPromise(getFn) { | |
let memoizedCalls = new Map(); | |
return function(...args) { | |
let serializedArgs = JSON.stringify(args); |
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
// Create bookmark with javascript: CODE_HERE | |
// Click on bookmark in meetup website | |
(function () { | |
var list = document.getElementById('rsvp-list').children, | |
item = list[Math.floor(Math.random() * list.length)], | |
name = item ? item.querySelector('h5.member-name a').innerHTML : 'N/A'; | |
item && item.parentNode.removeChild(item); | |
alert("And the winner!!! Is.... " + name); |
OlderNewer