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
(function () { | |
'use strict'; | |
angular.module('ConferenceRoomApp').filter('ordinalize', function () { | |
return function (number) { | |
var res = number.toString(); | |
if (/(11|12|13)/.test(Math.abs(number) % 100)) { | |
res = number + 'th'; | |
} else { |
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
(function () { | |
'use strict'; | |
angular.module('ConferenceRoomApp').filter('multifilter', function ($filter) { | |
return function (collection, query) { | |
var filteredCollection = collection; | |
var queryTokens = query ? query.split(' ') : [query]; | |
// user entered more than word | |
if (queryTokens.length > 1) { |
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.controller('SearchCtrl', ['$scope', '$compile', '$templateCache', function ($scope, $compile, $templateCache) { | |
// I figured out how to read my angular template from the $templateCache, but not | |
// sure how to make it "come to life" with the scope and whatnot. | |
var memberCardTpl = $templateCache.get('member-card.html'); | |
// I can use Hogan to compile the angular template, but none of the directives work. Hogan | |
// knows nothing about Angular. | |
//var resultTpl = Hogan.compile($templateCache.get('member-card.html')); | |
// this scoped variable is set in the controller and then later |
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
# @gf3’s Sexy Bash Prompt, inspired by “Extravagant Zsh Prompt” | |
# Shamelessly copied from https://github.com/gf3/dotfiles | |
# Screenshot: http://i.imgur.com/s0Blh.png | |
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then | |
export TERM=gnome-256color | |
elif infocmp xterm-256color >/dev/null 2>&1; then | |
export TERM=xterm-256color | |
fi |
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
#!/usr/local/bin/ruby | |
grep = `git grep -n #{ARGV[0]} #{ARGV[1]}` | |
puts "\n-----------------------------------------------------------" | |
puts "GREP RESULT" | |
puts '-----------------------------------------------------------' | |
puts grep | |
files = grep.scan /.*\:\d+/ |
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
class AuthenticationsController < ApplicationController | |
def index | |
@authentications = current_user.authentications if current_user | |
end | |
def create | |
omniauth = request.env["omniauth.auth"] | |
authentication = Authentication.find_by_provider_and_uid(omniauth['provider'], omniauth['uid']) | |
if authentication |
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
/* | |
* truncatable 1.2 - jQuery lightwieght text truncation plugin | |
* | |
* Copyright (c) 2009 Philip Beel (http://www.theodin.co.uk/) | |
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) | |
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. | |
* | |
* Revision: $Id: jquery.truncatable.js 2009-08-20 $ | |
* | |
*/ |
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
Error: | |
Problem at line 20 character 21: 'options' is already defined. | |
var options = $.extend(defaults, options); | |
Problem at line 39 character 47: Use '===' to compare with 'true'. | |
if (defaults.less == true) { |
NewerOlder