This file contains 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 appendStyle = function(){ | |
var htmlstr = '<link rel="stylesheet" '+ | |
'href="https://gist.github.com/stylesheets/gist/embed.css" '+ | |
'type="text/css" />'; | |
$('head').append( htmlstr ); | |
} | |
/* | |
look for tags [gist]#######[/gist] and for each one found, insert a | |
div with an id attribute that references the gist's id |
This file contains 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 App = angular.module('App', []); | |
App.controller('TodoCtrl', function($scope, $http) { | |
$http.get('todos.json') | |
.then(function(res){ | |
$scope.todos = res.data; | |
}); | |
}); |
This file contains 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 App = angular.module('App', []); |
This file contains 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 evens = _.filter([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; }); | |
console.log(evens); |
This file contains 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
# = require '../components/jquery/jquery' | |
# = require '../components/angular-complete/angular' | |
Controllers = angular.module 'controllers', [] | |
Controllers.controller 'PhoneListCtrl', ['$scope', ($scope)-> | |
$scope.phones = [ | |
{name: "Nexus S", snippet: "Fast just got faster with Nexus S."}, |
This file contains 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
%ng-form(name="circleEditForm") | |
%label Circle Name: | |
%input(type="text" name="circleName" | | |
ng-minlength= 3 | | |
ng-model="circleModal.name" | | |
ng-maxlength= 8 | | |
maxlength= 8 | | |
required | | |
ng-class="{error: !circleEditForm.circleName.$valid}" ) |
This file contains 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
namespace :js do | |
require 'sprockets' | |
environment = Sprockets::Environment.new(File.dirname(__FILE__)) | |
environment.append_path 'src/bower' | |
environment.append_path 'src/coffee' | |
source_code = environment['app.coffee'] | |
desc 'compile CoffeeScript with Sprockets' | |
task :compile do |
This file contains 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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
concat: { | |
js: { | |
src: 'src/js/*.js', | |
dest: 'dest/js/concat.js' | |
}, | |
css: { | |
src: 'src/css/*.css', |
This file contains 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
app.config( function( $httpProvider ) { | |
var interceptor = function( $q ) { | |
return function( promise ) { | |
var success = function(res) { | |
if(res.data && res.data[0]){ | |
if(typeof res.data[0] === 'string'){ | |
var data = res.data, | |
ret = []; |
This file contains 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 app = angular.module('app', []); | |
app.config(function($locationProvider, $routeProvider) { | |
$locationProvider.html5Mode(true); | |
$routeProvider | |
.when('/', { | |
templateUrl: '/partials/template1.html', // <- relative to base | |
controller: 'ctrl1' | |
}) | |
.when('/tags/:tagId', { |