Skip to content

Instantly share code, notes, and snippets.

View clawfire's full-sized avatar
🐻
Being cool

Thibault Milan clawfire

🐻
Being cool
View GitHub Profile
@clawfire
clawfire / functions.php
Created May 7, 2011 23:36
Wordpress custom post
<?php
/*-----------------------------------------------------------------------------------*/
/* Create a new post type called course
/*-----------------------------------------------------------------------------------*/
function create_post_type_courses()
{
$labels = array(
'name' => __( 'Course'),
'singular_name' => __( 'Course' ),
@clawfire
clawfire / functions.php
Created May 20, 2011 12:51
Let Some JS file know some Wordpress Constant
<?php
/**
* DEFINVE SOME VARIABLE FOR MY JS FILES
*/
function environment_var(){
?>
<script type="text/javascript">
var templatePath = "<?php bloginfo('template_directory') ?>";
</script>
@clawfire
clawfire / plugin.js
Created May 20, 2011 14:58
Load dynamic content for a caroussel
$("#caroussel-arrow ul li button").click(function(){
var clicked_arrow = $(this).attr('id');
var current_categ = $("#caroussel-content").data('config').categ;
var current_offset = $("#caroussel-content").data('config').offset;
if(clicked_arrow == 'right' && current_offset<12){
$("#caroussel-content").html("<img class='loading' src='' alt='loading'/>")
var new_offset = current_offset+4;
console.log('droite and offset '+new_offset);
$.get(templatePath+'/inc/caroussel.php',{ loop: current_categ , offset: new_offset},function(data){
$("#caroussel-content").html(data);
@clawfire
clawfire / plugin.js
Created May 22, 2011 11:09
animation on each element of a caroussel, binded by a custom event
$('#caroussel-content').bind('caroussel-change',function(){
$('#caroussel-content figure').mouseenter(function(){
$(this).children("figcaption").animate({top: "0"}, 500);
}).mouseleave(function(){
$(this).children("figcaption").animate({top: "220px"}, 500);
});
});
@clawfire
clawfire / snippet.html
Created June 9, 2011 12:43
Like button, counter mode, no faces, no text , no send
<iframe src="http://www.facebook.com/plugins/like.php?app_id=207035349334157&amp;href&amp;send=false&amp;layout=button_count&amp;width=200&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=lucida+grande&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px;" allowTransparency="true"></iframe>
@clawfire
clawfire / caroussel.jQuery.js
Created October 12, 2011 10:23
jQuery Caroussel Helper
(function($){
$.fn.diaporama = function(options) {
var defaults = {
delay: 3,
animationSpeed: "normal",
controls:true
};
var options = $.extend(defaults, options);
sudo apt-get install mutter
sudo mutter --replace
sudo sh /usr/share/ati/fglrx-uninstall.sh
sudo apt-get remove --purge fglrx fglrx_* fglrx-amdcccle* fglrx-dev* xorg-driver-fglrx
sudo apt-get install build-essential cdbs fakeroot dh-make debhelper debconf libstdc++6 dkms libqtgui4 wget execstack libelfg0 dh-modaliases