Skip to content

Instantly share code, notes, and snippets.

View sebby's full-sized avatar
🏠
Working from home

Sébastien Cunin sebby

🏠
Working from home
View GitHub Profile
<?php
// Utilisable dans le CMS Drupal
$wrapper = entity_metadata_wrapper('node', $node);
dsm($wrapper->book->author->mail->value());
dsm($wrapper->book->title->value());
dsm($wrapper->book->label(),'Titre de book');
dsm($wrapper->label(),'Titre du noeud');
# 1ere règle
tell application "Adium"
go away with message "Podomoro en cours | back at " & (time string of ((current date) + 25 * minutes))
end tell
# 2eme règle
tell application "Adium"
go available
end tell
@sebby
sebby / example_async
Last active August 29, 2015 13:55
Exemple d'utilisation de la lib Async (browser)
async.parallel([
function(callback){
setTimeout(function(){
console.log('flag1');
callback(null,{"flag1":new Date()});
}, 2000);
},
function(callback){
setTimeout(function(){
console.log('flag2');
@sebby
sebby / gist:9155786
Last active August 29, 2015 13:56
#javascript #async exemple d'une utilisation de async.parallel
var fct_one = function (callback){
callback(null,Math.random()*10000);
};
async.parallel({
one: fct_one,
two: function(callback){
callback(null,2);
},
three:fct_one
@sebby
sebby / gist:9206226
Last active August 29, 2015 13:56
#drupal #patch
## Liste de patches Drupal/Module
Avoir la jquery 1.4 (drupal default) dans le module jQuery Update
https://drupal.org/node/1548028
(la rajouter dans le drush make de ZeeAgency
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]" />
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<select id="select1" multiple>
<option value="1">valeur 1</option>
@sebby
sebby / Package Control.sublime-settings
Last active June 21, 2017 14:17
Settings sur mon ST3
{
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"A File Icon",
"AdvancedNewFile",
"AngularJS",
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
h5{
@sebby
sebby / example_theme_table.php
Last active April 5, 2019 13:36
example for Drupal 8
<?php
$content = array();
$content['container'] = ['#type'=>'fieldset','#title'=>'4ème bloc'];
$header = array('Cell 1', 'Cell 2');
$data = array(
array('A', 'B'),
array('C', 'D'),
array('E', 'F')
);
$content['container'][] = [
@sebby
sebby / trans.html.twig
Last active April 19, 2022 06:00
Comment utiliser le filtre trans de Twig avec des placeholders. #twig #drupal
{#
@link https://www.drupal.org/node/2047135
This syntax is extremely complex to scan. This also requires the front-end developer to know about the @ ! % "Drupalism" prefix of placeholders and what each of them do.
#}
<p class="submitted">{{ "Submitted by !author on @date"|t({ '!author': author, '@date': date }) }}</p>