This file contains hidden or 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
var sample = _.chain(this.sidebarItems) | |
.pluck('title') | |
.sample(3) | |
.value(); | |
var placeholder = '"' + sample.join('", "') + '"'; | |
// Result: '"Blink", "Tear flow", "Acommodation"' |
This file contains hidden or 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 if given string is "fuzzy-found" within a longer string, the "pattern" | |
* @return {[boolean]} [returns true if src can be "fuzzy-found" within the pattern] | |
*/ | |
export default function(str, pattern) { | |
str = str.toLowerCase(); | |
pattern = pattern.toLowerCase(); | |
// Code shamelessly borrowed from Jan Dvorak, you're awesome! http://codereview.stackexchange.com/questions/23899/faster-javascript-fuzzy-string-matching-function | |
pattern = pattern.split("").reduce(function(a,b){ return a+".*"+b; }); |
This file contains hidden or 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
set nocompatible | |
let iCanHazNeoBundle=1 | |
let neobundle_readme=expand($HOME.'/.vim/bundle/neobundle.vim/README.md') | |
if !filereadable(neobundle_readme) | |
echo "Installing NeoBundle.." | |
echo "" | |
silent !mkdir -p $HOME/.vim/bundle | |
silent !git clone https://github.com/Shougo/neobundle.vim $HOME/.vim/bundle/neobundle.vim | |
let iCanHazNeoBundle=0 | |
endif |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
pets: Ember.computed(function() { | |
return ['dog', 'cat', 'fish']; | |
}), | |
checkAnyBy: Ember.computed('pets', function() { | |
console.log(this.get('pets').anyBy('cat')); | |
return this.get('pets').anyBy('cat'); | |
}), |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
obj: Ember.Object.create({thing: 'Foo'}), | |
objThing: Ember.computed('obj.[]', function() { | |
return this.get('obj.thing'); | |
}), | |
init: function() { | |
this._super(); | |
Ember.run.later(() => { |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
actions: { | |
foo: function(...args) { | |
console.log('Hit foo in bottom'); | |
this.sendAction('foo', ...args); | |
} | |
} | |
}); |
This file contains hidden or 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
[ | |
{ | |
"casting_time": "1 segment", | |
"classes": [ | |
"sorcerer", | |
"wizard" | |
], | |
"components": { | |
"raw": "V, S", | |
"material": false, |
This file contains hidden or 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
{ | |
"casting_time": "test", | |
"classes": ["sorcerer"], | |
"components": {"raw": "test"}, | |
"description": [ | |
"**Wow!**", | |
"| First Header | Second Header |", | |
"| ------------- | ------------- |", | |
"| Content Cell | Content Cell |", | |
"| Content Cell | Content Cell |" |
This file contains hidden or 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
let userIsTypingStuff = document.querySelectorAll('input:focus, textarea:focus').length !== 0; |