Skip to content

Instantly share code, notes, and snippets.

View remi's full-sized avatar
👋

Rémi Prévost remi

👋
View GitHub Profile
<?php
function RSS_populateItemTemplate( $item ) {
$content = $item->children('http://purl.org/rss/1.0/modules/content/')->encoded;
return array(
'content' => $content
);
}
<?php
/**
* This filter makes it easy to use the same WordPress theme and resources
* accross multiple WordPress MU blogs.
*/
function my_global_template_url( $url ) {
// Uncomment this to use Amazon S3
// return 'http://mybucket.s3.amazonaws.com';
diff --git a/svn-color.sh b/svn-color.sh
index ac9d15b..6c8c90e 100755
--- a/svn-color.sh
+++ b/svn-color.sh
@@ -12,14 +12,14 @@ function svn
test "$CMDLEN" = "${#CMD}"
if [ $? = 1 ] || [ ! -t 1 ]
then
- $(whereis svn) $CMD
+ $(which svn) $CMD
#!/bin/sh
# run this file with sudo and TextEdit will be open as if it was open by root
exec /Applications/TextEdit.app/Contents/MacOS/TextEdit
<?php
// ancienne ligne 54
set_include_path( get_include_path() . PATH_SEPARATOR . $path . PATH_SEPARATOR . $path_pear );
// nouvelle ligne 54
set_include_path( $path . PATH_SEPARATOR . $path_pear . PATH_SEPARATOR . get_include_path() );
<?php
Pubwich::setServices(
array(
array(
//...
array( 'Gowalla', 'gowalla-stamps', array(
'method' => 'GowallaUserStamps',
'username' => '____your_username____',
'password' => '____your_password____',
'key' => '____your_api_key____',
<?php
// Détermine si la page "$id" a comme ancêtre la page "$ancestor_id"
function is_page_ancestor( $id, $ancestor_id ) {
$p = get_post( $id );
while ( $p->post_parent ) {
if ( $p->post_parent == $ancestor_id ) { return true; }
$p = get_post( $p->post_parent );
}
}
@remi
remi / iPatch.sh
Created April 14, 2010 17:34 — forked from jmlacroix/iPatch.sh
#!/bin/bash
IPATH="/Applications/iTunes.app/Contents/MacOS"
if [ ! -e "$IPATH/iTunesX" ]
then
sudo mv "$IPATH/iTunes" "$IPATH/iTunesX"
# has sudo failed?
if (( $? ))
// Instead of using $('div').parent().parent().parent().parent().addClass('lol')
// you can use this: $('div').parentx(4).addClass('lol')
if ( window.jQuery ) {
jQuery.fn.parentx = function( i ) {
if ( i > 1 ) {
var e = $(this);
for ( var a = 1; a <= i; a++ ) {
e = e.parent();
}
var a = "";
a == "" // true
var a = [];
a == [] // false
// damnit, Javascript…