Skip to content

Instantly share code, notes, and snippets.

View csakiistvan's full-sized avatar
🏔️
happiness

Csáki István csakiistvan

🏔️
happiness
View GitHub Profile
@csakiistvan
csakiistvan / facebook div
Created May 27, 2014 17:23
Facebook like for multilanguage drupal website
<div class="fb-like" data-href="#" data-layout="standard" data-action="like" data-show-faces="false" data-share="true"></div>
@csakiistvan
csakiistvan / template.php
Last active August 29, 2015 14:02
add different css in different languages
<?php
/**
* Implements hook_preprocess_page().
*/
function mytheme_preprocess_page(&$vars) {
drupal_add_css(drupal_get_path('theme', 'mytheme') . '/css/mytheme_lang_' . $vars['language']->language . '.css');
}
@csakiistvan
csakiistvan / mymodule.module
Created July 1, 2014 14:32
how to create a translatable drupal pane title
<?php
/**
* Implements hook_preprocess_panels_pane().
*/
function hook_preprocess_panels_pane(&$vars) {
// Allow translation before substitution.
if (
!empty($vars['pane']->configuration['override_title'])
&& !empty($vars['pane']->configuration['override_title_text'])
@csakiistvan
csakiistvan / gist:42ff9250b4c9bb218601
Last active August 29, 2015 14:04
Gradient mixins
// Gradients
// Horizontal gradient, from left to right
//
// Creates two color stops, start and end, by specifying a color and position for each color stop.
// Color stops are not available in IE9 and below.
@mixin gradient-horizontal($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
background-image: -webkit-linear-gradient(left, color-stop($start-color $start-percent), color-stop($end-color $end-percent)); // Safari 5.1-6, Chrome 10+
/* iCheck plugin Flat skin, ip
----------------------------------- */
.icheckbox_flat-ip,
.iradio_flat-ip {
display: inline-block;
*display: inline;
vertical-align: middle;
margin: 0;
padding: 0;
@include iv-sprite-background();
@csakiistvan
csakiistvan / theme.js
Created August 15, 2014 09:06
Enable Bootstrap 3 Hover Dropdowns.
(function ($) {
Drupal.behaviors.mytheme_name = {
attach: function (context) {
// Enable Bootstrap 3 Hover Dropdowns.
var width = $(document).width();
if (width >= 976) {
$('.dropdown-toggle').click(function() {
var location = $(this).attr('href');
window.location.href = location; return false;
});
@csakiistvan
csakiistvan / init.sh
Created August 31, 2014 09:42
After make run shell script
#!/bin/bash
# base variables
cd $(dirname $0)/../../..
drupal_root=`pwd`
if [ "$1" == "live" ]; then
drush vset preprocess_css 0
drush vset preprocess_js 0
drush vset --exact -y install_profile newprofile
@csakiistvan
csakiistvan / gist:e365bebac3a41333c24f
Last active August 29, 2015 14:10
Rewrite all user email address with drush
drush sqlsan --sanitize-email=user+%uid@example.com
@csakiistvan
csakiistvan / gist:298f48633a0761f6b4b7
Created May 7, 2015 09:28
Add class all block in specified region
/**
* Implements hook_preprocess_block().
*
* @see block.tpl.php
*/
function base_theme_preprocess_block(&$variables) {
if ($variables['elements']['#block']->region == 'footer') {
$variables['classes_array'][] = 'col-xs-12 col-sm-6 col-md-3';
}
}
@csakiistvan
csakiistvan / gist:c4502ba9efda8661d351
Created September 3, 2015 13:32
Import to sql database directly
mysql -uroot -proot dbname < filename.mysql