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
<a class="drop-down-toggle">Click me to reveal drop down box below...</a> | |
<div class="drop-down-wrapper"> | |
Hello, I will be revealed! | |
</div> |
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 home | |
if current_user.present? | |
redirect_to projects_url | |
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
window.addEventListener("orientationchange", function() { | |
alert(window.orientation); | |
//do whatever you want on orientation change here | |
}, false); |
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
.videoWrapper { | |
position: relative; | |
padding-bottom: 56.25%; | |
padding-top: 25px; | |
height: 0; | |
} | |
.videoWrapper iframe { | |
position: absolute; | |
top: 0; |
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
@mixin css-arrow($color:#000, $size:'5px', $direction:'up') | |
width: 0 | |
height: 0 | |
@if $direction == 'up' | |
border-right: $size solid transparent | |
border-left: $size solid transparent | |
border-bottom: $size solid $color | |
@if $direction == 'down' |
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 'Delete this junk', junk_path(j), :method => :delete, :confirm => 'You sure you want to delete this junk?' %> |
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 ApplicationHelper | |
def current_class?(test_path) | |
return 'active' if request.path == test_path | |
'' | |
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
/** | |
* Implements hook_entity_info_alter(). | |
*/ | |
function MYMODULE_entity_info_alter(&$entity_info) { | |
$entity_info['node']['view modes']['another_teaser'] = array( | |
'label' => t('Another teaser'), | |
'custom settings' => TRUE, | |
); | |
} |
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
// block_load docs: https://api.drupal.org/api/drupal/modules%21block%21block.module/function/block_load/7 | |
// Get the arguments from the second- and third-to-last segments of a block's configure URL | |
// For instance: /#overlay=admin/structure/block/manage/webform/client-block-150/configure | |
$block = block_load('webform','client-block-150'); | |
print drupal_render(_block_get_renderable_array(_block_render_blocks(array($block)))); |