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
ModelUtils = require('../../shared/modelUtils') | |
module.exports = class AddClassMapping | |
constructor: (@utils)-> | |
@utils ||= new ModelUtils | |
add: (key, modelConstructor)=> | |
@utils._classMap[@utils.underscorize(key)] = modelConstructor; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet"> | |
<link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.0/css/font-awesome.min.css" rel="stylesheet"> | |
<style type="text/css"> | |
.btn-facebook{ | |
padding: 0px; | |
overflow: hidden; |
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 BaseModel, ModelStore, modelUtils, _; | |
ModelStore = require('../shared/store/model_store'); | |
BaseModel = require('../shared/base/model'); | |
modelUtils = require('../shared/modelUtils'); | |
_ = require('underscore'); | |
util = require('util'); | |
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/bin/env ruby | |
# do not check in code with <<<<< nor debugger | |
diff_contents = `git diff --cached --unified=0 --diff-filter=AM -z HEAD` | |
bad_commit_text = diff_contents =~ /^\+(<{3,}|(\s*|.*;\s*)debugger)/ | |
abort "Aborting: Found debugger or <<< in commit diff." if bad_commit_text | |
# looks for text in reminders.txt | |
reminder_location = 'ignored/reminders.txt' | |
file_location = File.join( File.dirname(__FILE__), '..', '..', reminder_location) |
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
#!/bin/sh | |
[[ -d $(dirname $0)/../rebase-merge ]] || lolcommits --capture |
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
gem 'rspec' | |
gem 'debugger' |
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
RSpec::Matchers.define :have_body_text do |text| | |
match do |mail| | |
fail("No body content to check for #{text}") if mail.parts.blank? | |
assert_mail_text_in_all_parts(mail, text) | |
end | |
def assert_mail_text_in_all_parts(mail, text) | |
mail.parts.all? do |part| | |
part.body.include?(text) |
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
# pretty much copied from active_support | |
module ModuleConstMissing | |
def self.append_features(base) | |
base.class_eval do | |
# Emulate #exclude via an ivar | |
return if defined?(@_const_missing) && @_const_missing | |
@_const_missing = instance_method(:const_missing) | |
remove_method(:const_missing) | |
end | |
super |
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
<html> | |
<head> | |
<title>Middle height</title> | |
<style type="text/css"> | |
/*Positioning CSS*/ | |
.container{ | |
overflow: hidden; | |
position: relative; |
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
def humanized_seconds secs | |
[[60, :second], [60, :minute], [24, :hour], [1000, :day]].map{ |count, name| | |
name = name.to_s | |
if secs > 0 | |
secs, n = secs.divmod(count) | |
pluralized_name = n == 1 ? name : name.pluralize | |
"#{n.to_i} #{pluralized_name}" | |
end | |
}.compact.reverse.join(' ') | |
end |
NewerOlder