Skip to content

Instantly share code, notes, and snippets.

View elalemanyo's full-sized avatar
🥘
NaN

victor elalemanyo

🥘
NaN
View GitHub Profile
@juampynr
juampynr / README.md
Last active September 3, 2015 16:03
Custom Apache Solr Query

The following script is an example on how to build a custom query with Drupal's Apache Solr Search module.

In order to test it, you can copy the file to the root of your Drupal site, set the nid at the top, adjust the query and run it with the following Drush command:

drush scr custom_solr_query.php

You can find further details about it at this article from the Lullabot Blog.

@p01
p01 / live-coding-at-SG.html
Last active November 26, 2015 22:48
Live coding at Creative Coding Singapore
<style>
#b {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: radial-gradient(circle, #000, #123);
}
@thijsvdanker
thijsvdanker / date-views-pager.tpl.php
Last active December 28, 2015 00:29
Use month names as calendar pager for Drupal 7.
<?php
/**
* @file
* Template file for the example display.
*
* Variables available:
*
* $plugin: The pager plugin object. This contains the view.
*
* $plugin->view
@widyakumara
widyakumara / waitUntilExists.js
Created September 25, 2012 17:27
Wait Until Exists Version v0.2
/*
*
* DMW:
* http://javascriptisawesome.blogspot.nl/2011/07/faster-than-jquerydocumentready-wait.html
* http://pastebin.com/raw.php?i=XTDKbQvK
*
* Wait Until Exists Version v0.2 - http://javascriptisawesome.blogspot.com/
*
*
* TERMS OF USE - Wait Until Exists
@nexxos
nexxos / git mit 1&1
Last active May 15, 2017 20:38
Git beim Provider 1&1 nutzen. Erforderlich ist ein entsprechendes Paket, das git und ssh bietet. (Vorläufige Fassung)
# Haupt-FTP Passwort ist gleichzeitig SSH Passwort
# per SSH anmelden:
ssh username@mydomain.com
mkdir repo
cd repo
git init --bare my_repo.git
# Repo auf dem lokalen Rechner klonen:
@kellec
kellec / examples-and-output.css
Created April 12, 2012 02:10
a LESS mixin for versatile gradients (with IE support)
/* Basic two stop gradient */
.example-gradient {
.linear-gradient(150deg, #eee, #aaa);
}
/* Outputs */
.example-gradient {
background: -webkit-linear-gradient(150deg, #EEE 0%, #AAA 100%);
background: -moz-linear-gradient(150deg, #EEE 0%, #AAA 100%);
background: -ms-linear-gradient(150deg, #EEE 0%, #AAA 100%);
background: -o-linear-gradient(150deg, #EEE 0%, #AAA 100%);
@coreyworrell
coreyworrell / gist:1313678
Created October 25, 2011 18:06
JW Player - Stop other videos when playing
(function($) {
/**
* We have to get a collection of id's because the HTML5 player moves the DOM
* around and returns different elements when caching the selectors.
*/
var elements = $('.video-player > div, .video-player object'),
playerIds = [];
elements.each(function(i, player) {
playerIds.push(player.id);
@rupl
rupl / drupal-test.js
Last active November 18, 2017 23:24
This sample accompanies a blog post series about CasperJS found at http://fourword.fourkitchens.com/article/testing-drupal-casperjs
/**
* @file
* Testing a demo of Drupal. The script will log in and check for various
* features in Drupal core. This demo was inspired by a similar script for
* a Wordpress site. The original script was written by Henrique Vicente.
*
* @see https://github.com/henvic/phantom-casper-simple-talk/blob/master/wordpress.js
*/
// Set up variables to visit a URL and log in.
@waako
waako / template.php
Created February 3, 2012 18:15
Drupal, get theme path in javascript
<?php
function theme_preprocess_page(&$variables) {
drupal_add_js('jQuery.extend(Drupal.settings, { "pathToTheme": "' . path_to_theme() . '" });', 'inline');
}
?>
@davidmh
davidmh / gist:6228319
Last active June 26, 2018 15:57
iTerm Tab & Window Titles with zsh and git. original: http://timbabwe.com/2012/05/iterm_tab_and_window_titles_with_zsh
function precmd() {
if command git rev-parse --git-dir > /dev/null 2>&1; then
window_label=$(git rev-parse --show-toplevel)
tab_label=$(echo $window_label | awk -F\/ '{print "[git] " $NF}')
else
window_label=${PWD/${HOME}/\~}
tab_label=$window_label
fi
echo -ne "\e]2;${window_label}\a"
echo -ne "\e]1;${tab_label: -24}\a"