Skip to content

Instantly share code, notes, and snippets.

View nicksteffens's full-sized avatar

Nick Steffens nicksteffens

View GitHub Profile
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'li',
label: null,
click() {
this.send('toggleActiveTab', this.get('label')
}
});
@nicksteffens
nicksteffens / test-validator.js
Last active September 27, 2017 19:37
This is a test helper for checking allows / rejects in ember-cp-validations
import Ember from 'ember';
import { test } from 'ember-qunit';
function convertValuesToObjects(value) {
const data = { value };
if ( value === undefined || value === null ) {
data.display = `${value}`;
} else {
data.display = `'${value}'`;
@nicksteffens
nicksteffens / controllers.application.js
Last active May 11, 2017 20:37
cp-validations-test-helper
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@nicksteffens
nicksteffens / ember-conf-2017.md
Last active March 29, 2017 20:31
Cool things at ember conf 2017

Ember Engines (Todd Jordan @tddjordan)

  • Autonomy/Accountability
    • Namesspacing
    • Asset Sharing
    • Lazy Loading
    • Techinical Consistency
  • Ember-cli-dependency lint
    • Checks ember addons

Disables character menu - defaults write -g ApplePressAndHoldEnabled -bool true

@nicksteffens
nicksteffens / Ionic Research Kit Dynamic Survey.js
Last active April 26, 2016 19:38
This is a work around for creating a survey with dynamic data
// irkResults must be passed in to have access to the service
.controller('SurveyCtrl', ['config', '$scope', '$ionicModal', '$http', 'irkResults', function(config, $scope, $ionicModal, $http, irkResults) {
$scope.takingSurvey = false;
$scope.surveyError = false;
$scope.openModal = function() {
$scope.takingSurvey = true;
getQuestions();
};
@nicksteffens
nicksteffens / createMinMaxArrayWithIncrement.js
Last active January 29, 2016 00:28
This will create and array of numbers, starting from min and max with eh numbers in-between being incremented a consistent amount
function createMinMaxArrayWithIncrement(minNum, maxNum, increment) {
var values = [minNum, maxNum],
nextMin = (minNum + increment) - (minNum % increment);
for(var i = nextMin; i < maxNum; i += increment) {
values.splice(values.length -1, 0, i);
}
return values;
}
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@nicksteffens
nicksteffens / Color Less Mixin
Created May 13, 2015 18:50
Color mixin for name gen
// ............................................................
// .for
.for(@i, @n) {.-each(@i)}
.for(@n) when (isnumber(@n)) {.for(1, @n)}
.for(@i, @n) when not (@i = @n) {
.for((@i + (@n - @i) / abs(@n - @i)), @n);
}
@nicksteffens
nicksteffens / Sublime User Preferences
Created May 11, 2015 21:52
Sublime User Preferences
{
"color_scheme": "Packages/User/SublimeLinter/base16-ocean.light (SL).tmTheme",
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
"bower_components",