Skip to content

Instantly share code, notes, and snippets.

@hunterloftis
hunterloftis / gist:5527881
Created May 6, 2013 20:23
subcategories filter
app.filter('subcategories', function() {
return function(movies, categories) {
var matching = [];
_.each(movies, function(movie) {
var missingTags = (_.difference(categories, movie.subcategoryList).length > 0);
if (!missingTags) matching.push(movie);
});
@hunterloftis
hunterloftis / gist:5527759
Created May 6, 2013 20:08
carousel attempt #1
app.directive('carousel', function() {
var HEIGHT = 321;
var SPACING = 12;
var template = "\
<div class='carousel-container'>\
<h1 class='carousel-title'>{{movies.carouselTitle}}</h1>\
<div class='carousel'>\
<div class='carousel-slider'>\
@hunterloftis
hunterloftis / gist:5515427
Last active December 16, 2015 23:39
Using filters programmatically in a custom directive
// current (works)
<div ng-repeat='movie in movies.titles | subcategories:categoryList()'>
// goal:
<div ng-repeat='filteredMovies()'>
link: function(scope, element, attrs) {
scope.filteredMovies = function() {
~/work/cheetah (lifecycle *) $ make serve
[default] VM already created. Booting if it's not already running...
/opt/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/spec_set.rb:90:in `block in materialize': Could not find i18n-0.6.4 in any of the sources (Bundler::GemNotFound)
from /opt/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/spec_set.rb:83:in `map!'
from /opt/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/spec_set.rb:83:in `materialize'
from /opt/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/definition.rb:113:in `specs'
from /opt/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/definition.rb:158:in `specs_for'
from /opt/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/definition.rb:147:in `requested_specs'
from /opt/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/environment.rb:23:in `requested_specs'
from /opt/ruby/lib/ruby/gems/1.9.1/gems/bundler-1.2.1/lib/bundler/runtime.rb:11:in `setup'
Create the admin user (press enter for defaults).
Email [[email protected]]: [y/N]
Password [spree123]: [y/N]
/opt/ruby/lib/ruby/gems/1.9.1/gems/ffaker-1.12.1/lib/ffaker.rb:2: warning: already initialized constant VERSION
[WARNING] Precompiled views present and Deface is enabled, this can result in overrides being applied twice.
rake aborted!
Don't know how to build task 'import:taxonomies'
/app/lib/tasks/sample.rake:22:in `block (3 levels) in <top (required)>'
/app/lib/tasks/sample.rake:5:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:sample
~/work/cheetah (change_product_color $) $ make restart
[default] VM already created. Booting if it's not already running...
[default] Resuming suspended VM...
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[WARNING] Precompiled views present and Deface is enabled, this can result in overrides being applied twice.
SocketError - getaddrinfo: Name or service not known:
/opt/ruby/lib/ruby/1.9.1/net/http.rb:762:in `initialize'
/opt/ruby/lib/ruby/1.9.1/net/http.rb:762:in `open'
= content_for :head
title= @branch.name
h1 This is a microsite
Stream connected nodejitsudb4187025225.redis.irstack.com:6379 id 1
Using default parser module: javascript
Sending auth to nodejitsudb4187025225.redis.irstack.com:6379 id 1
send nodejitsudb4187025225.redis.irstack.com:6379 id 1: *2
$4
auth
$32
{{ our auth string here }}
send_command buffered_writes: 0 should_buffer: false
{
"name": "sometest",
"version": "0.0.1",
"dependencies": {
"express": "3.0.0rc2"
}
}
~/work/canary (master *) $ jitsu logs
info: Welcome to Nodejitsu nko3-team-canary
info: jitsu v0.11.0, node v0.8.11
info: It worked if it ends with Nodejitsu ok
info: Executing command logs app
info: Attempting to load logs for /Users/hunter/work/canary/package.json
info: Listing logs for nko3-team-canary
[11/09 19:01:13 EST] Server running at http://0.0.0.0:8000/
[11/09 19:48:43 EST] Listening on 80
[11/09 19:48:46 EST] Redis connection gone from end event.