Skip to content

Instantly share code, notes, and snippets.

View screamwork's full-sized avatar

screamwork screamwork

  • Parts Unknown
  • 11:27 (UTC +02:00)
View GitHub Profile
@screamwork
screamwork / Hovercard Support for Drupal
Created April 27, 2011 19:27
Drupal - Hovercard Support
$api_key = "<your API-KEY>";
drupal_add_js("http://platform.twitter.com/anywhere.js?id={$api_key}&v=1");
@screamwork
screamwork / tabs-removal.php
Created April 27, 2011 19:30
Drupal - Removing tabs
function themename_preprocess_page(&$vars) {
//dsm($variables['tabs']);
themename_removetab('TABNAME', $vars);
}
/* remove a primary tab */
function themename_removetab($label, &$vars) {
$i = 0;
if (is_array($vars['tabs']['#primary'])) {
foreach ($vars['tabs']['#primary'] as $primary_tab) {
if ($primary_tab['#link']['title'] == $label) {
@screamwork
screamwork / jQuery - ScrollTop
Created April 11, 2012 23:21
jQuery - ScrollTop
$("html,body").animate({
scrollTop: $("#errorDivId").offset().top
}, 2000, function(){
//scroll complete function
});
@screamwork
screamwork / jQuery - Get URL vars
Created April 11, 2012 23:31
jQuery - Get URL vars
$.extend({
getUrlVars: function(){
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
@screamwork
screamwork / post-process.php
Created August 12, 2012 15:17 — forked from bueltge/post-process.php
WordPress Custom Post Type: Insert post via Frontend
<?php
/**
* post-process.php
* make sure to include post-process.php in your functions.php. Use this in functions.php:
*
* get_template_part('post-process');
*
*/
function do_insert() {
if( 'POST' == $_SERVER['REQUEST_METHOD']
@screamwork
screamwork / custom-menu-items.php
Created August 17, 2017 07:35 — forked from daggerhart/custom-menu-items.php
WordPress class for easily adding custom menu items dynamically to a menu.
<?php
class custom_menu_items {
// only register with wp hooks once
protected $has_registered = false;
// internal list of menus affected
public $menus = array();
// internal list of new menu items
mkdir /app/nano && \
curl https://github.com/Ehryk/heroku-nano/raw/master/heroku-nano-2.5.1/nano.tar.gz --location --silent | tar xz -C /app/nano && \
export PATH=$PATH:/app/nano
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.