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
ActiveAdmin.register Questionnaire do | |
index do | |
column :id do |questionnaire| | |
link_to questionnaire.id, admin_questionnaire_path(questionnaire) | |
end | |
column :title do |questionnaire| | |
link_to questionnaire.title, admin_questionnaire_path(questionnaire) | |
end | |
column :csv_export do |questionnaire| | |
link_to "CSV Export", csv_export_admin_questionnaire_path(questionnaire, :format => :csv) |
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
<%= link_to posts_path, class: "dropdown-toggle", "data-toggle" => "dropdown" do %> | |
<%= @username %> | |
<b class="caret"></b> | |
<% end %> |
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
/* line 44, ../../app/assets/stylesheets/application.css.scss */ | |
.blibla, .bliblablub { | |
background: black; | |
} | |
/* line 48, ../../app/assets/stylesheets/application.css.scss */ | |
.bliblablub { | |
color: white; | |
} |
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
s_full = "South" | |
tests = [ | |
["Some text with S", "S", "South", "Some text with South"], | |
["Some text with S/wrong", "S/wrong", "Something wrong", "Some text with Something wrong"], | |
["Some text with S/wrong", "S", "South", "Some text with S/wrong"] | |
] | |
def match(where, what, replace) | |
where.gsub(/\b#{Regexp.quote(what)}(\s|\z|$)/, replace + '\1') | |
end |
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/bash | |
# Favicon and Apple Touch Icon Generator | |
# | |
# This bash script takes an image as a parameter, and uses ImageMagick to convert it to several | |
# other formats used on modern websites. The following copies are generated: | |
# | |
# * apple-touch-icon-114x114-precomposed.png | |
# * apple-touch-icon-57x57-precomposed.png | |
# * apple-touch-icon-72x72-precomposed.png |
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 SignedParamsHelper | |
def signed_params! | |
controller(described_class) { before_filter { params.permit! } } | |
end | |
end |
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
describe UsersController | |
controller(UsersController) do | |
before_filter :permit_all_params! | |
def permit_all_params! | |
params.permit! | |
end | |
end | |
end |
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
public class MyClass | |
{ | |
public static void main(String args[]) | |
{ | |
System.out.println("Hello World".hashCode()); | |
} | |
} | |
=> -862545276 |
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
I have two cats. One of them is black, the other is white. Both are fine, but when someone tries to feed the white one the black one will suddenly burst into flames". Can you see the reason for the cat incineration? Neither can we see the reason for your error, since we have no idea about your {insert your language/framework here} cats. Add code, provide a short example. |
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
<p> | |
<b>Comment:</b> | |
<%= comment.body %> | |
</p> | |
<p> | |
<%= link_to 'Destroy Comment', [comment.post, comment], | |
:confirm => 'Are you sure?', | |
:method => :delete %> | |
</p> |