This file contains hidden or 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 RSS_populateItemTemplate( $item ) { | |
$content = $item->children('http://purl.org/rss/1.0/modules/content/')->encoded; | |
return array( | |
'content' => $content | |
); | |
} |
This file contains hidden or 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 | |
/** | |
* 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'; |
This file contains hidden or 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
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 |
This file contains hidden or 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/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 |
This file contains hidden or 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 | |
// 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() ); |
This file contains hidden or 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 | |
Pubwich::setServices( | |
array( | |
array( | |
//... | |
array( 'Gowalla', 'gowalla-stamps', array( | |
'method' => 'GowallaUserStamps', | |
'username' => '____your_username____', | |
'password' => '____your_password____', | |
'key' => '____your_api_key____', |
This file contains hidden or 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 | |
// 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 ); | |
} | |
} |
This file contains hidden or 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 | |
IPATH="/Applications/iTunes.app/Contents/MacOS" | |
if [ ! -e "$IPATH/iTunesX" ] | |
then | |
sudo mv "$IPATH/iTunes" "$IPATH/iTunesX" | |
# has sudo failed? | |
if (( $? )) |
This file contains hidden or 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
// 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(); | |
} |
This file contains hidden or 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
var a = ""; | |
a == "" // true | |
var a = []; | |
a == [] // false | |
// damnit, Javascript… |
OlderNewer