Skip to content

Instantly share code, notes, and snippets.

View karma86's full-sized avatar

Maria Karoutsou karma86

  • Netcompany-Intasoft
View GitHub Profile
@karma86
karma86 / javascript: add browser class on html
Created July 18, 2013 16:23
Add browser class on html tag
/*CSS Browser Selector v0.4.0 (Nov 02, 2010)
Rafael Lima (http://rafael.adm.br)
http://rafael.adm.br/css_browser_selector
License: http://creativecommons.org/licenses/by/2.5/
Contributors: http://rafael.adm.br/css_browser_selector#contributors
*/
function css_browser_selector(u) {
var ua = u.toLowerCase(),
is = function(t) {
return ua.indexOf(t) > -1
@karma86
karma86 / Drupal site install in seconds.md
Last active December 17, 2015 12:09
Drupal site install in seconds

Using drush with .make files

Drush make file is a plain-text file, which describes the components of a drupal installation. Drush can use it to create ready-to-use drupal sites, pulling sources from various locations. It does this by parsing a makefile and downloading the sources it describes. In practical terms, this means that it is possible to distribute a complicated Drupal distribution as a single text file.

Using a .make generator

  • Select the version of drupal you want to install
  • Select the modules you want
  • Select the libaries you want to use
@karma86
karma86 / Javascript: redirect_when_youtube_ends.js
Last active December 11, 2015 20:38
Javascript file to redirect to a certain url when a youtube video ends
//Place the <div id="player"></div> on your content page
var tag = document.createElement('script');
// This is a protocol-relative URL as described here:
// http://paulirish.com/2010/the-protocol-relative-url/
// If you're testing a local page accessed via a file:/// URL, please set tag.src to
// "https://www.youtube.com/iframe_api" instead.
tag.src = "//www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];