This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#--------------------------------------------------------------------- | |
# Example configuration for a possible web application. See the | |
# full configuration options online. | |
# | |
# https://www.haproxy.org/download/1.8/doc/configuration.txt | |
# | |
#--------------------------------------------------------------------- | |
#--------------------------------------------------------------------- | |
# Global settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git fetch --prune | |
git branch -vv | grep -i 'gone' | awk '{print $1}' | xargs git branch -D | |
git fsck --full | |
git reflog expire --expire=now --all | |
git repack -a -d -l | |
git gc --prune=now --aggressive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Author: Matteo Canu <soraph88@gmail.com> | |
# Handy script to resize and optimize image size. | |
# Version 0.2.1 | |
# 2020-02-07: Linting and cleanup | |
wkpath= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const sRange = (from, to, includeUpperLimit = false) => { | |
/* | |
* Params: | |
* | |
* from: integer, first value of cycle and the Array | |
* to: integer, last value of the cycle | |
* includeUpperLimit: boolean, if true will use to as last | |
* element of the Array | |
* | |
* Works like Python's range() but two params are mandatory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| | |
if html_tag.match(/class=(\'|\")([\w\s\d]*?)\1/i) | |
html_tag.gsub(/class=(\'|\")([\w\s\d]*?)\1/i, 'class="\2 has-error"') | |
else | |
html_tag.gsub(/\<[\w]+/i, '\0 class="has-error"') | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_menu() { | |
$items['path/page'] = array( | |
'title' => t('Page title'), | |
'page callback' => 'mypage_callback_function', | |
'page arguments' => array('my','totally','optional','argumet','list'), | |
); | |
return $items; | |
} | |
// All your other module logic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pre { | |
font-family: monospace; | |
white-space: pre-wrap; /* css-3 */ | |
white-space: -moz-pre-wrap; /* Mozilla */ | |
white-space: -pre-wrap; /* Opera 4-6 */ | |
white-space: -o-pre-wrap; /* Opera 7 */ | |
word-wrap: break-word; /* Internet Explorer 5.5+ */ | |
/* | |
padding: XX; | |
margin: XX; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function yourtheme_css_alter(&$css){ | |
$to_be_removed = array('sites/all/modules/example_module/styles/example_module_css.css' => FALSE,); | |
$css = array_diff_key($css,$to_be_removed); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function yourtheme_js_alter(&$javascript) { | |
[...]your stuffs[...] | |
$jquery_new = drupal_get_path('theme','yourtheme') . '/js/jquery-1.10.2.min.js'; | |
$javascript[$jquery_new] = $javascript['misc/jquery.js']; | |
$javascript[$jquery_new]['version'] = '1.10.2'; | |
$javascript[$jquery_new]['data'] = $jquery_new; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_headers.c> | |
Header append X-UA-Compatible "IE=edge,chrome=1" | |
<FilesMatch "\.(appcache|crx|css|eot|gif|htc|ico|jpe?g|js|m4a|m4v|manifest|mp4|oex|oga|ogg|ogv|otf|pdf|png|safariextz|svg|svgz|ttf|vcf|webm|webp|woff|xml|xpi)$"> | |
Header unset X-UA-Compatible | |
</FilesMatch> | |
</IfModule> |
NewerOlder