Skip to content

Instantly share code, notes, and snippets.

View verteb's full-sized avatar

Dominic Simard verteb

View GitHub Profile
@verteb
verteb / jquery-ui-localize-calendar.js
Created June 12, 2013 13:53
jQueryUI : Localize Calendar
//Localisation du calendrier
$.datepicker.regional['fr-CA'] = {
closeText: 'Fermer',
prevText: 'Précédent',
nextText: 'Suivant',
currentText: 'Aujourd\'hui',
monthNames: ['janvier', 'février', 'mars', 'avril', 'mai', 'juin',
'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre'],
monthNamesShort: ['janv.', 'févr.', 'mars', 'avril', 'mai', 'juin',
'juil.', 'août', 'sept.', 'oct.', 'nov.', 'déc.'],
@verteb
verteb / orientation-change.js
Created June 12, 2013 13:52
Mobile Orientation Change
function doOnOrientationChange()
{
switch(window.orientation)
{
case -90:
case 90:
alert('landscape');
break;
default:
alert('portrait');
@verteb
verteb / jgrid.css
Created June 10, 2013 15:14
CSS - Grid responsive justify
.jGrid {
text-align: justify;
display: block;
padding: 0;
margin: 0;
letter-spacing: 0.1px;
text-rendering: optimizespeed;
}
.jGrid:after{
content: '';
@verteb
verteb / gist:5363561
Created April 11, 2013 13:53
jQuery sticky element
<style>
#sticky.stick {
position: fixed;
top: 0;
z-index: 99999999999;
}
</style>
<script>
function sticky_relocate() {
var window_top = $(window).scrollTop();
@verteb
verteb / gist:5363517
Created April 11, 2013 13:49
jQuery scroll whole screen to element
$('html, body').animate({
scrollTop: $("#element").offset().top
}, 1200);
@verteb
verteb / gist:4345693
Created December 20, 2012 14:50
PHP : Date en texte français
<?php
setlocale(LC_ALL, 'fr_FR');
list($year, $month, $day) = explode('-', get_field('date'));
$dateString = strftime("%e %B %Y", mktime(0, 0, 0, $month, $day, $year));
?>
@verteb
verteb / gist:4131382
Created November 22, 2012 14:14
Flash with noscript replacement
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="780" height="420">
<param name="movie" value="myContent.swf" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="myContent.swf" width="780" height="420">
<!--<![endif]-->
<!-- CODE DE REMPLACEMENT DE FLASH ICI -->
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
@verteb
verteb / gist:4125605
Last active September 2, 2016 19:25
Wordpress : Query Custom Post Type
$arguments = array(
'post_type' => 'type',
'posts_per_page' => -1,
//'meta_key'=> 'my-sort-key',
'orderby'=> 'menu_order',
'order' => 'ASC'
);
query_posts($arguments);
@verteb
verteb / gist:4125533
Created November 21, 2012 15:43
Wordpress : Update Query
global $query_string;
query_posts( $query_string . '&order=ASC&posts_per_page=-1' );
@verteb
verteb / gist:4069377
Created November 14, 2012 00:30
Wordpress : Custom post type
//Realisations
$labels = array(
'name' => __('Realisations', 'realisations'),
'singular_name' => __('Realisation', 'realisations'),
'add_new' => __('Ajouter', 'realisations'),
'add_new_item' => __('Ajouter Realisation', 'realisations'),
'edit_item' => __('Modifier Realisation', 'realisations'),
'new_item' => __('Realisation Realisation', 'realisations'),
'view_item' => __('Voir Realisation', 'realisations'),
'search_items' => __('Rechercher Realisation', 'realisations'),