Skip to content

Instantly share code, notes, and snippets.

View alexanderjeurissen's full-sized avatar

Alexander Jeurissen alexanderjeurissen

View GitHub Profile
import Ember from 'ember';
import FilterSelectMixin from 'applicationfilter-select';
const {RSVP} = Ember;
export default Ember.Controller.extend(FilterSelectMixin, {
search: '',
filter: '',
queryParams: ['search', 'filter'],
sortAscending: false,
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
function generateAlphaNumericLabels(amount) {
var labels = [];
for (var i = 0; i <= amount; i++) {
var appendNumber = 0;
var offset = 0;
if (i > 25 && i <= 34) {
appendNumber = i - 25;
labels.push(String.fromCharCode(65 + offset) + appendNumber);
//GistId: 1e59a17
{
"preset": "google",
"maximumLineLength": 120,
"disallowSpacesInsideObjectBrackets": null,
"disallowSpacesInFunctionExpression": null,
"disallowSpacesInAnonymousFunctionExpression": null,
"disallowMultipleVarDecl": true,
# -polka-
# Remove the default keybinding
unbind C-b
# Set a new keybinding to C-/. In terminals C-/ is the same as C-_
# however in tmux we can't bind to C-/
set -g prefix C-t
# lower interval for faster updates
// updated GulpFile for react-development-environment-setup lesson from egghead.io
// https://egghead.io/lessons/react-development-environment-setup
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var reactify = require('reactify');
gulp.task('browserify', function () {
var bundleStream = browserify('./src/js/main.js')
//GistID:1c45ca694ad333baeddd
'use strict';
angular.module('stateMock', []);
angular.module('stateMock').service("$state", function($q) {
this.expectedTransitions = [];
this.current = {};
this.transitionTo = function(stateName) {
if (this.expectedTransitions.length > 0) {
var expectedState = this.expectedTransitions.shift();
## 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
@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());
}
};
});
@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()
};