Skip to content

Instantly share code, notes, and snippets.

View yoanmarchal's full-sized avatar
💭
I may be slow to respond.

Marchal yoan yoanmarchal

💭
I may be slow to respond.
View GitHub Profile
@yoanmarchal
yoanmarchal / isoTransform.js
Created October 23, 2012 12:23 — forked from tdreyno/isoTransform.js
Isotope CSS3 jQuery cssHooks
// ========================= getStyleProperty by kangax ===============================
// http://perfectionkills.com/feature-testing-css-properties/
var getStyleProperty = (function(){
var prefixes = ['Moz', 'Webkit', 'Khtml', 'O', 'Ms'];
var _cache = { };
function getStyleProperty(propName, element) {
@yoanmarchal
yoanmarchal / html5_template.html
Created October 23, 2012 12:26 — forked from nathansmith/html5_template.html
Simple HTML5 Template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge, chrome=1" />
<title>untitled</title>
<link rel="stylesheet" href="" />
</head>
<body>
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!-- Consider adding an manifest.appcache: h5bp.com/d/Offline -->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
/* normal case */
@font-face {
font-family: "DejaVu Sans";
src: url(‘path-to-font-directory/DejaVuSans.eot’);
src: local(‘☺’), url("path-to-font-directory/DejaVuSans.ttf") format("truetype");
}
/* bold */
@font-face {
font-family: "DejaVu Sans";
@yoanmarchal
yoanmarchal / youtube-vimeo-embed-urls.php
Created November 7, 2012 10:50 — forked from cballou/youtube-vimeo-embed-urls.php
PHP Function to Convert Youtube and Vimeo URLs to Lightbox-Ready Equivalents
<?php
/**
* Given a string containing any combination of YouTube and Vimeo video URLs in
* a variety of formats (iframe, shortened, etc), each separated by a line break,
* parse the video string and determine it's valid embeddable URL for usage in
* popular JavaScript lightbox plugins.
*
* In addition, this handler grabs both the maximize size and thumbnail versions
* of video images for your general consumption. In the case of Vimeo, you must
* have the ability to make remote calls using file_get_contents(), which may be
@yoanmarchal
yoanmarchal / file-upload-handler.php
Created November 20, 2012 13:59 — forked from daltonrooney/file-upload-handler.php
Multi-file WordPress uploads from the front-end
<?php /* This function attaches the image to the post in the database, add it to functions.php */
function insert_attachment($file_handler,$post_id,$setthumb='false') {
// check to make sure its a successful upload
if ($_FILES[$file_handler]['error'] !== UPLOAD_ERR_OK) __return_false();
require_once(ABSPATH . "wp-admin" . '/includes/image.php');
require_once(ABSPATH . "wp-admin" . '/includes/file.php');
require_once(ABSPATH . "wp-admin" . '/includes/media.php');
@yoanmarchal
yoanmarchal / Wordpress add nb views
Last active October 13, 2015 05:37
récupère stock "dans une meta" et montre le nombre de vue par page
//recupere et stock dans une balise meta le nombre de vue par page
function getPostViews($postID){
$count_key = 'post_views_count';
$count = get_post_meta($postID, $count_key, true);
if($count==''){
delete_post_meta($postID, $count_key);
add_post_meta($postID, $count_key, '0');
return "<p>0 Visite</p>";
}
@yoanmarchal
yoanmarchal / dabblet.css
Created December 18, 2012 20:14 — forked from LeaVerou/dabblet.css
Scrolling shadows by @kizmarh and @LeaVerou
/**
* Scrolling shadows by @kizmarh and @leaverou
* Only works in browsers supporting background-attachment: local; & CSS gradients
* Degrades gracefully
*/
html {
background: white;
font: 120% sans-serif;
}
@yoanmarchal
yoanmarchal / responsive.css
Created January 9, 2013 14:01 — forked from arielsalminen/responsive.css
responsive slider css + jquery
#slideshow {
width: 100%;
position: relative;
}
img {
top: 0;
left: 0;
width: 100%;
max-width: 600px;
@yoanmarchal
yoanmarchal / ios-web-app.html
Created June 25, 2013 19:46 — forked from tfausak/ios-8-web-app.html
meta apple / android favicon
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="yes" name="apple-mobile-web-app-capable">
<title>iOS Web App</title>
<!-- iPhone -->