Skip to content

Instantly share code, notes, and snippets.

👶
Parenting

Jaime Vintharas

👶
Parenting
Block or report user

Report or block Vintharas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Vintharas
Vintharas / random-attendee.js
Last active Apr 5, 2017 — forked from mzabriskie/random-attendee.js
Select random Meetup attendee
View random-attendee.js
// 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);
@Vintharas
Vintharas / gulp.config.js
Last active Jul 17, 2018
Sample gulpfile for a complete pipeline with ES6 and SASS
View gulp.config.js
/* eslint strict: [2, "global"] */
'use strict';
/*** Main paths ***/
var projectRoot = './',
root = './myProject.web/', // project root
index = root + 'Views/Shared/Layouts/',
src = root + 'Content/', // source code
temp = root + 'temp/', // temporary folder
dist = src + 'dist/', // generated code
@Vintharas
Vintharas / memoize.js
Last active Jan 22, 2016
Memoize using a promise (angular $q)
View memoize.js
/*
*
* Memoizes call to a service using a promise
*
*/
function memoizeWithPromise(getFn) {
let memoizedCalls = new Map();
return function(...args) {
let serializedArgs = JSON.stringify(args);
@Vintharas
Vintharas / ngDirective.js
Last active Sep 24, 2015
Angular directive ReSharper Live Template
View ngDirective.js
/*
* $description$ directive.
*
* Usage:
* <vtf-$directiveName$></vtf-$directiveName$>
*
*/
(function () {
'use strict';
@Vintharas
Vintharas / gist:f0d29f39662f282d6ca0
Created Mar 2, 2015
AutoFixture MVC Controller Customization
View gist:f0d29f39662f282d6ca0
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));
}
}
@Vintharas
Vintharas / gist:aaa4d760308d0b9af177
Created Mar 2, 2015
MVC, ModelState Helpers, HasErrors
View gist:aaa4d760308d0b9af177
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));
}
}
@Vintharas
Vintharas / test
Created Feb 13, 2015
ReSharper NUnit Test live template
View test
[Test]
public void $methodName$_When$context$_Should$expectedResult$()
{
// Arrange
$END$
// Act
// Assert
}
@Vintharas
Vintharas / gist:bfa5709746f9dbea3794
Created Jan 28, 2015
Mocking IDBSet IQueryable with Moq
View gist:bfa5709746f9dbea3794
using System.Data.Entity;
using System.Linq;
using Moq;
namespace Platform.Domain.Tests.Helpers
{
public class QueryableDbSetMock
{
public static IDbSet<T> GetQueryableMockDbSet<T>(params T[] sourceList) where T : class
{
View my gitconfig from work
[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
@Vintharas
Vintharas / sublime_text_windows.json
Created Nov 15, 2014
Sublime text preferences windows
View sublime_text_windows.json
{
"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,
You can’t perform that action at this time.