Skip to content

Instantly share code, notes, and snippets.

@partageit
partageit / offset0.html
Created May 31, 2014 20:49
Bootstrap offset 0
<html>
<head>
<meta charset="UTF-8">
<title>Test offset Bootstrap</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<style>
.col { color: #ffffff; height: 250px; line-height: 250px; font-size: 4em; text-align: center; }
.col1 { background-color: #34495e; }
.col2 { background-color: #2c3e50; }
.col3 { background-color: #95a5a6; }
@partageit
partageit / less-yo-angular-Gruntfile.js
Created June 5, 2014 12:55
Partage-it.com : Less et yo angular - Gruntfile.js
// New task:
[...]
karma: {
[...]
},
less: {
server: {
files: {
"<%= yeoman.app %>/styles/style.css": "<%= yeoman.app %>/less/*.less"
}
@partageit
partageit / wordpress-anti-spambot-functions.inc.php
Created June 16, 2014 08:26
Partage-it.com : système anti spambot de commentaire pour WordPress
<?php
// Ajout le nouveau 'vrai' champ et change celui qui existe en leurre à spambot
function addAntiSpambotField($fields) {
$newUrlFieldName = "url2";
$fields["url2"] = str_replace(array("for=\"url\"", "id=\"url\"", "name=\"url\""), array("for=\"$newUrlFieldName\"", "id=\"$newUrlFieldName\"", "name=\"$newUrlFieldName\""), $fields["url"]);
$fields["url"] = '<input type="url" id="url" name="url" value="">';
return $fields;
}
add_filter("comment_form_default_fields", "addAntiSpambotField");
@partageit
partageit / header-mono-page.php
Last active August 29, 2015 14:03
Partage-it.com : Header du template monopage pour Twenty Thirteen
<?php
/**
* En-tête du template mono page pour Twenty Thirteen
* Copié du header.php et modifié pour un thème enfant
*/
?><!DOCTYPE html>
<!--[if IE 7]>
<html class="ie ie7" <?php language_attributes(); ?>>
<![endif]-->
<!--[if IE 8]>
@partageit
partageit / template-mono-page.php
Last active August 29, 2015 14:03
Partage-it.com : template monopage pour Twenty Thirteen
<?php
/**
Template name: Mono page
Copié depuis page.php de Twenty Thirteen
*/
get_header("mono-page"); ?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
@partageit
partageit / functions-mono-page.php
Last active August 29, 2015 14:03
Partage-it.com : fonctions nécessaires pour le template monopage pour Twenty Thirteen
<?php
// Ajoute Bootstrap pour le scrollspy et l'affix
function enqueueStyles() {
wp_enqueue_style("bootstrap", get_stylesheet_directory_uri() . "/css/bootstrap/css/bootstrap.min.css");
wp_enqueue_script('jquery');
wp_enqueue_script('bootstrap-js', get_stylesheet_directory_uri() . '/js/bootstrap.min.js', 'jquery' );
}
add_action("wp_enqueue_scripts", "enqueueStyles");
@partageit
partageit / functions-bootstrap-carousel-shortcode-v2.php
Last active August 29, 2015 14:04
Partage-it.com : amélioration du shortcode du carrousel d'articles pour WordPress avec Twitter Bootstrap
@partageit
partageit / blueimp-yeoman-angularjs-Uploader.js
Created September 11, 2014 12:07
Partage-it.com : le contrôleur d'upload pour blueimp-file-upload
'use strict';
angular.module('testBlueimpApp')
.controller('UploaderCtrl', function ($scope, $http) {
var uploadScriptUrl = 'http://localhost/test-upload/index.php';
$scope.options = {
url: uploadScriptUrl
};
$scope.loadingFiles = true;
$http.get(uploadScriptUrl)
@partageit
partageit / blueimp-yeoman-angularjs-FileDestroy.js
Created September 11, 2014 12:08
Partage-it.com : le contrôleur de suppression de fichiers pour blueimp-file-upload
'use strict';
angular.module('testBlueimpApp')
.controller('FileDestroyCtrl', function ($scope, $http) {
var file = $scope.file,
state;
if (file.url) {
file.$state = function () {
return state;
};
@partageit
partageit / blueimp-yeoman-angularjs-main.html
Last active August 29, 2015 14:06
Partage-it.com : la vue pour blueimp-file-upload
<form id="fileupload" method="POST" enctype="multipart/form-data" ng-controller="UploaderCtrl" file-upload="options" ng-class="{'fileupload-processing': processing() || loadingFiles}">
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
<div class="row fileupload-buttonbar">
<div class="col-lg-7">
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button" ng-class="{disabled: disabled}">
<i class="glyphicon glyphicon-plus"></i>
<span>Add files...</span>
<input type="file" name="files[]" multiple ng-disabled="disabled">
</span>