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
.parent { | |
position: relative; | |
} | |
.parent:before { | |
content: ""; | |
position: absolute; | |
top: 0; | |
left: 0; | |
right: 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
# Don't cache anything | |
<ifModule mod_headers.c> | |
Header unset ETag | |
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate" | |
</ifModule> |
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> | |
<meta charset="utf-8"> | |
<title>Form</title> | |
</head> | |
<body> | |
<form> |
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
<?php | |
$file = remote_stream_wrapper_file_create_by_uri($uri); | |
$file_result = file_save($file); |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<div class="gallery-item">1</div> | |
<div class="gallery-item">2</div> | |
<div class="gallery-item">3</div> | |
<div class="gallery-item">4</div> | |
<div class="gallery-item">5</div> | |
<div class="gallery-item">6</div> | |
<div class="gallery-item">7</div> | |
<div class="gallery-item">8</div> | |
<div class="gallery-item">9</div> | |
<div class="gallery-item">10</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
// Cross-scope compatible placeholder boilerplate. | |
@mixin my-mixin($extend: true) { | |
@if $extend { | |
@extend %my-mixin; | |
} | |
@else { | |
// Mixin core | |
} | |
} |
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 () { | |
////////////////////////////// | |
// Add event (cross browser) | |
// From http://stackoverflow.com/a/10150042 | |
////////////////////////////// | |
function addEvent(elem, event, fn) { | |
if (elem.addEventListener) { | |
elem.addEventListener(event, fn, false); | |
} else { | |
elem.attachEvent('on' + event, function() { |
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
<div class="gallery-item"> | |
</div> | |
<div class="gallery-item"> | |
</div> | |
<div class="gallery-item"> | |
</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
<?php | |
//assuming $node exists | |
$my_collection = entity_create('field_collection_item', array('field_name' => 'field_my_collection')); | |
$my_collection->setHostEntity('node', $node); | |
$my_collection->field_text_data[LANGUAGE_NONE][0]['value'] = "hello"; | |
$my_collection->field_term_ref[LANGUAGE_NONE][0]['tid'] = 123; | |
$my_collection->field_node_ref[LANGUAGE_NONE][0]['target_id'] = 345; | |
$my_collection->save(); | |
node_save($node); |