Skip to content

Instantly share code, notes, and snippets.

View alexanderjeurissen's full-sized avatar

Alexander Jeurissen alexanderjeurissen

View GitHub Profile
#GistID:9526183
# javascript
node_modules
coverage
dist
.tmp
npm-debug.log
app/bower_components
*.tern.project
#GistID:9531777
[user]
name = Alexander Jeurissen
email = alexanderjeurissen@gmail.com
[diff]
external = git_diff_wrapper
[pager]
diff =
[color]
ui = auto
#GistID: 9818509
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
{
"node" : true,
"browser" : true,
"es5" : false,
"esnext" : true,
"bitwise" : true,
"camelcase": true,
"curly" : true,
"eqeqeq" : true,
"immed" : true,
#!/bin/sh
echo $*
vimdiff "$1" "$2"
# GistID: 10715991
StringLiterals:
EnforcedStyle: double_quotes
Enabled: true
Style/ClassLength:
CountComments: false # count full line comments?
Max: 150
Documentation:
Enabled: false
@alexanderjeurissen
alexanderjeurissen / fixParsingInconsistencies.js
Last active August 29, 2015 14:01
This gist is a slightly modified version from the plunker of Emil van Galen. It basically forces angular to set a ng-model value to null instead of an empty string (when this directive is applied and the model value is empty). a blog post about the issue and some additional solutions can be found here: (http://blog.jdriven.com/2013/09/how-angula…
'use strict';
angular.module('ModuleName')
.directive('fixParsingInconsistencies', function () {
return {
require: '?ngModel',
priority: (angular.version.full.indexOf('1.2.') === 0 &&
angular.version.full !== '1.2.0rc1' &&
angular.version.full !== '1.2.0-rc.2') ? 1 : 0,
restrict: 'A',
@alexanderjeurissen
alexanderjeurissen / parseFileName.js
Created August 1, 2014 10:39
A simple file name parser factory for angular projects.
angular.module('appointment')
.factory('FileNameParser', function () {
return {
parse: function (file) {
var extensionPattern = /\.[0-9a-z]+$/i;
var extension = extensionPattern.exec(file);
return {
file_name: file.replace(extension, ''),
file_type: extension[0].replace('.', '').toLowerCase()
};
@alexanderjeurissen
alexanderjeurissen / includeReplace.js
Created September 21, 2014 11:45
based on http://stackoverflow.com/a/24921498 It's a solution to the deprecation of `replace:true` attribute on directives.
app.directive('includeReplace', function () {
return {
require: 'ngInclude',
restrict: 'A', /* optional */
link: function (scope, el, attrs) {
el.replaceWith(el.children());
}
};
});
## Global Snippets
# Define a new Angular Controller;
# You can change the controller name and parameters
snippet ngc
.controller(${1:controllerName}, ['$scope', '${2:controllerDependencies}',
function($scope, ${4:injectables}) {
${5}
};
]);
# angular.foreach loop