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
// add the filter to your application module | |
angular.module('yourAppName', ['filters']); | |
/** | |
* Truncate Filter | |
* @Param string | |
* @Param int, default = 10 | |
* @Param string, default = "..." | |
* @return string | |
*/ |
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
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
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
function AttachmentCtrl($scope, $location, $timeout, Docs) { | |
$(function() { | |
$('#detail-form-doc').fileupload({ | |
dataType: 'json', | |
url: '/angular-ib/app/fileupload?id=' + $location.search().id, | |
add: function(e, data) { | |
$scope.$apply(function(scope) { | |
// Turn the FileList object into an Array | |
for (var i = 0; i < data.files.length; i++) { | |
$scope.project.files.push(data.files[i]); |
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
# http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
uuid = () -> | |
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace /[xy]/g, (c) -> | |
r = Math.random()*16|0 | |
if c == 'x' | |
v = r | |
else | |
v = (r&0x3|0x8) |
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
RSpec::Matchers.define :have_key do |expected| | |
def value | |
@value | |
end | |
def cache_record | |
@cache_record | |
end | |
def has_cache_key? |
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
# Here are the settings that are common to all environments | |
common: &default_settings | |
# ============================== LICENSE KEY =============================== | |
# You must specify the license key associated with your New Relic | |
# account. This key binds your Agent's data to your account in the | |
# New Relic service. | |
license_key: '<%= ENV["NEW_RELIC_LICENSE_KEY"] %>' | |
# Agent Enabled (Rails Only) |
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
gem 'chronic' | |
group :development, :test do | |
gem 'foreman' | |
gem 'debugger' | |
gem 'turn', :require => false | |
gem 'spork-rails' | |
# gem 'spork-testunit' |
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 "bootstrap/variables"; // Modify this for custom colors, font-sizes, etc | |
@import "bootstrap/mixins"; | |
@import "bootstrap/alerts"; | |
@import "bootstrap/type"; | |
@import "bootstrap/tables"; | |
.ui-datepicker { | |
display: none; | |
background-color: #fff; |
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
class TablelessModel | |
include ActiveModel::Validations | |
include ActiveModel::Conversion | |
extend ActiveModel::Naming | |
def initialize(attributes = {}) | |
attributes.try(:each) do |name, value| | |
send("#{name}=", value) | |
end | |
end |
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
angular.module("app.Standards", []) | |
.config(function($httpProvider, $locationProvider) { | |
$locationProvider.html5Mode(false); | |
$locationProvider.hashPrefix('!'); | |
$httpProvider.defaults.headers. | |
common['X-CSRF-Token'] = $('meta[name=csrf-token]').attr('content'); | |
}) |