Skip to content

Instantly share code, notes, and snippets.

View jeremyboggs's full-sized avatar

Jeremy Boggs jeremyboggs

View GitHub Profile
@jeremyboggs
jeremyboggs / custom.php
Created November 6, 2012 14:22
Custom show_item_metadata function for Omeka that loops through an internal array of labels and their associated fields.
<?php
/**
* Show Item Metadata function that loops through an internal array of labels
* and their associated fields.
*
* @param Item|null $item
* @return string The HTML for the item metadata.
*/
function berlin_show_item_metadata($item = null)
@jeremyboggs
jeremyboggs / remove_item_edit_form_element.php
Created November 6, 2012 16:44
Remove a form element in Omeka
<?php
add_filter(array('ElementForm', 'Item', 'Dublin Core', 'Title'), 'remove_form_item_title');
function remove_form_item_title($components, $args) {
$components['html'] = ''; // Set the html component to an empty string.
return $components;
}
@jeremyboggs
jeremyboggs / simple-search.scss
Created November 26, 2012 21:29
SCSS/Compass styles for a simple search form.
#search-form {
position:relative;
@include trailer(1);
input {
margin:0;
&[type=text] {
color: #555;
width:100%;
border: 0;
@jeremyboggs
jeremyboggs / back-to-top.js
Created January 21, 2013 14:48
Simple back-to-top button with jQuery.
/**
* Show or hide the button depending on the scroll position.
*/
function animateButton() {
var button = $('#back-to-top');
var scrollPosition = $(window).scrollTop();
if (scrollPosition > 400) {
button.fadeIn();
} else {
button.fadeOut();
<?php if ($collection = get_collection_by_id(@$_GET['collection'])) {
echo $collection->name;
echo $collection->description;
} ?>
<?php
$string = '$(document).ready(function() {projekktor(".projekktor").setFile(' . $playlist . ');});';
queue_js_string($string);
?>
<meta name="viewport" content="width=device-width">
@jeremyboggs
jeremyboggs / filter_elements.php
Last active December 14, 2015 21:59
Hides elements unless an Omeka user is logged in.
<?php
/**
* Unset elements if there is not current authenticated user.
*/
function filter_elements($elementsBySet) {
/* An array of elements in sets to be hidden from non-authenticated users. */
$hiddenElements = array(
'Dublin Core' => array(
<!DOCTYPE HTML>
<html>
<head>
<title>CSS Practice</title>
<style type="text/css">
</style>
</head>
<body>
<h1>CSS Practice</h1>
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
#map { height: 500px; }
</style>
<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAzygx7txI_uXKJX1JD_czX7iH8BGRubI0&sensor=false">
</script>