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
= f.input :parent_id, collection: @article.comments, label_method: :ancestry_label_method, value_method: :id, as: :select, include_blank: true |
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
jQuery -> | |
$("input#select-all-reports").live "click", (e) -> | |
if $(this).is(':checked') | |
$("input.selected-reports:not(:checked)").each -> | |
$(this).attr('checked','checked') | |
else | |
$("input.selected-reports:checked").each -> | |
$(this).removeAttr('checked'); |
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
updateTotalManualFeeSubTotals = function() { | |
var subtotal; | |
subtotal = 0.0; | |
$("td.manual-fee-sub-total").map(function() { | |
var value; | |
value = parseFloat(this.innerHTML.replace("$", "")); | |
if (!isNaN(value)) { | |
return value; | |
} | |
}).each(function(i, e) { |
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
# See: https://gist.github.com/1353500 | |
# Use: it { should accept_nested_attributes_for(:association_name).using_has_one(true).and_accept({valid_values => true}).but_reject({ :reject_if_nil => nil })} | |
RSpec::Matchers.define :accept_nested_attributes_for do |association| | |
match do |model| | |
@model = model | |
@nested_att_present = model.respond_to?("#{association}_attributes=".to_sym) | |
if @nested_att_present && @reject | |
model.send("#{association}_attributes=".to_sym,[@reject]) | |
@reject_success = model.send("#{association}").empty? | |
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
RewriteEngine On | |
RewriteLog /var/log/apache2/jrop-rewrite.log | |
RewriteLogLevel 0 | |
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f |
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
/* {{{ | |
************************** | |
* Mark Holmberg : [email protected] | |
* Purpose: calculate the average number of coins needed to make change | |
* Tue Oct 13 15:46:34 MDT 2009 | |
* CS 3310 : Discrete Math | |
* }}} */ | |
#include <iostream> | |
#include <vector> |
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
Show hidden characters
[ | |
{ "keys": ["super+shift+down"], "command": "select_lines", "args": {"forward": true} }, | |
] |
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
for i in `find . -name "feature-*" -type d`; do | |
nice=`echo $i | sed 's!^\.\/!\/!g'`; | |
pushd /Users/mark/Desktop/test$nice; | |
mv *.html ~/dev/stuff/app/views/feature/; | |
mv *.js ~/dev/stuff/app/assets/javascripts/; | |
mv css *.css ~/dev/stuff/app/assets/stylesheets/; | |
mv *.jpg *.png *.gif ~/dev/stuff/app/assets/images/; | |
popd; | |
done |
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
# Force SSL | |
RewriteCond %{HTTPS} off | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} |
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
<snippet> | |
<content><![CDATA[ | |
.panel.panel-default | |
.panel-heading | |
%h4 ${1:General Information} | |
.panel-body | |
.table-responsive | |
${2:Content Here} | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> |