Skip to content

Instantly share code, notes, and snippets.

@gagarine
gagarine / my_mixin.less
Created May 23, 2012 12:12
mixin than I miss in twitter bootstrap
// mixin than I miss in twitter bootstrap
// Convert px to em
// For default context use the same value than @baseFontSize but without unit
.font-size( @target: @basefont, @context: 13 ) {
font-size: (@target / @context) + 0em;
}
@gagarine
gagarine / drupal hébergement.md
Created May 26, 2012 13:11
drupal hébergement
<p class="highlight" style="text-align: justify; line-height: 14px; margin-top: 0px; margin-bottom: 14px; font-family: Arial,Helvetica,sans;">TEST</p>
<p class="highlight" style="text-align: justify; line-height: 14px; margin-top: 0px; margin-bottom: 14px; font-family: Arial,Helvetica,sans;">sdf</p>
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAu7cj9p+6TiYG8/TB6rBDSTSFHEYucqPytohs0GoMv+/NDxsde2/bR7f+TA80FzxRaRjUs5ypDl5mLvmsjp73DTYrrDFg+aoWRUKmRGySqHGa6bk3Xy0N6TBiVYD2T2Vy98oklhdfnhuQtuRKY3FtuoGiwaQwyB8AIybl/Y8MlBz295eX4696QMZtzcy6rYCE31iAneLHvaMcftaSsUY1wXW6lL25WFAY1qQLAm4wNNqueCv7ZbBEbx0PVhYvzH/ar5Q/7NKTCPe7csjBPim2soBKBbvOruYp41nnn+yyMXCNToe2sP3wU63fbRoZHkz4sFF7zlfWlsNNxTkLGHVr/Q== [email protected]
<?php
$result = db_query("SELECT name, filename FROM {system} WHERE type = 'module' AND status = 0 ORDER BY filename");
$bad_module = array();
while ($module = db_fetch_object($result)) {
//var_dump($module);
if (!file_exists($module->filename)) {
$bad_module[] = $module;
}
}
var_dump($bad_module);
@gagarine
gagarine / .htaccess
Created June 19, 2012 10:46
.htaccess for drupal with browser language detection
#
# Apache/PHP/Drupal settings:
#
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$">
Order allow,deny
</FilesMatch>
# Don't show directory listings for URLs which map to a directory.
@gagarine
gagarine / template.tpl.php
Created July 29, 2012 21:11
Working with drupal theme_menu_tree
<?php
/**
* Theme_menu_tree doesn't provide any context information
* THIS SUCKS
* But you can use hook_block_view_alter to change the theme wrapper
* OUF!
*/
function MYTHEME_menu_tree(&$variables) {
@gagarine
gagarine / site.conf
Created August 3, 2012 13:25
drupal nginx and browser language detection
map $http_accept_language $lang {
default de;
~*fr fr;
~*it it;
}
server {
server_name _ site.com;
root /var/www/site.com/drupal;
client_max_body_size 10m;
@gagarine
gagarine / fabfile.py
Created November 13, 2012 09:05
drupal deployment
from __future__ import with_statement
from fabric.api import *
@task
def prod():
env.hosts = ['100.100.100.100']
env.user = ""
env.password = ""