Skip to content

Instantly share code, notes, and snippets.

@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 / survey.r
Last active July 4, 2018 13:48
survey.r
### Packages
install.packages(c( "rstudioapi", "corrplot"))
suppressWarnings(
suppressMessages({
library(rstudioapi)
library(readr)
library(psych)
@gagarine
gagarine / install_php_ngninx.sh
Created February 17, 2012 14:18
Drupal on php-fpm + nginx + apc
brew update
brew install gmp
#install Nginx
brew install nginx
# copy launch script
cp /usr/local/Cellar/nginx/1.0.12/homebrew.mxcl.nginx.plist ~/Library/LaunchAgents/
#try to launch Nginx
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
@gagarine
gagarine / keybase.md
Created April 15, 2018 19:51
keybase.md

Keybase proof

I hereby claim:

  • I am gagarine on github.
  • I am perdrisat (https://keybase.io/perdrisat) on keybase.
  • I have a public key ASDCDme3531K0n5Y30Urub_ld7T8w3Nu4-msaTcuqTNqQgo

To claim this, I am signing this object:

@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 / .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 / TP1.R
Last active October 31, 2016 18:16
##
# TP1
# Simon Perdrisat & Amantin Baruti- 2016
# Replication table 4b p 494 of "ECONOMIC AND POLITICAL EXPLANATIONS OF HUMAN RIGHTS VIOLATIONS" by NEIL J. MITCHELL and JAMES M. McCORMICK
#
# Note: I'm using = instead of <-
# http://blog.revolutionanalytics.com/2008/12/use-equals-or-arrow-for-assignment.html
#
##
From 43c894588777fa219440dea797a5460bb8e7e95a Mon Sep 17 00:00:00 2001
From: gagarine <simon@antistatique.net>
Date: Mon, 25 Feb 2013 15:25:32 +0100
Subject: [PATCH] make the export function works
---
wp/wp-content/plugins/surveys/export.php | 19 ++++++++++---------
wp/wp-content/plugins/surveys/export_choose.php | 2 +-
2 files changed, 11 insertions(+), 10 deletions(-)
@gagarine
gagarine / note.md
Last active December 12, 2015 08:39
Documentation store and annotate

Target

Storage

  • Store documents
  • Get the structure of plain text (title, chapter, paragraphe, sentence, line, word we want to turn in link) to a structured version (XML)
  • Store structured documents in a NoSQL database (or git?)

Annotations

  • Attach annotation in document

Version and history

@gagarine
gagarine / website-launch.md
Created January 17, 2013 08:34
checkliste

Test multi-platformes

  • IE
  • IOS
  • Android
  • Chrome
  • Firefox

Sécurité et performance

  • Désactivé les compte de test