Skip to content

Instantly share code, notes, and snippets.

View shulard's full-sized avatar
🌍
Working from anywhere…

Stéphane HULARD shulard

🌍
Working from anywhere…
View GitHub Profile
@shulard
shulard / Article.md
Created December 11, 2012 16:31 — forked from Warry/Article.md
How to make faster scroll effects?

How to make faster scroll effects?

  • Avoid too many reflows (the browser to recalculate everything)
  • Use advanced CSS3 for graphic card rendering
  • Precalculate sizes and positions

Beware of reflows

The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows:

@shulard
shulard / .gitignore
Last active August 29, 2015 14:10
24 jours de web: Comment bien versionner mon site WordPress avec Git et Github
#Installation Wordpress
/wp-cms/*
#Contenus non versionnés
/wp-content/uploads/
/wp-content/plugins/
#Configuration
/wp-config.php

Keybase proof

I hereby claim:

  • I am shulard on github.
  • I am shulard (https://keybase.io/shulard) on keybase.
  • I have a public key whose fingerprint is 9401 AF5A 33D4 D2CD D720 0997 1A0B 1D84 38A7 4EAC

To claim this, I am signing this object:

@shulard
shulard / swipe.js
Created June 10, 2015 14:04
Just a swipe detection in javascript
var $el = $('... selector');
$el.bind({
touchstart: function(event) {
$el.data('start.x',event.originalEvent.touches[0].pageX);
},
touchmove: function(event) {
$el.data('delta', event.originalEvent.touches[0].pageX - $el.data('start.x'));
},
touchend: function(event) {
if( Math.abs($el.data('delta')) > 100 ) {
@shulard
shulard / login.feature
Last active November 12, 2015 08:48
Behat sample features
Feature: Login
In order to use my application
As a website user
I need to be logged
Scenario: Try to log as a valid user
Given I am authenticated as "admin"
Then I should be on "/sites"
Scenario: Try to log with invalid credentials
Verifying that +shulard is my blockchain ID. https://onename.com/shulard
@shulard
shulard / .atoum.php
Last active January 21, 2016 16:59
Atoum Configuration
<?php
$script->setBootstrapFile(__DIR__.'/mon/fichier/bootstrap.php');
@shulard
shulard / php-cli_ovh_mutu.md
Created February 11, 2016 16:46 — forked from floptwo/php-cli_ovh_mutu.md
OVH PHP-CLI

PHP-CLI (PHP en ligne de commande) sur les hébergements mutualisés OVH

(cli)

/usr/local/php5.3/bin/php  =>  PHP 5.3.29 (cli) (built: Dec 10 2014 16:59:41)
/usr/local/php5.4/bin/php  =>  PHP 5.4.38 (cli) (built: Feb 26 2015 09:53:00)
/usr/local/php5.5/bin/php  =>  PHP 5.5.22 (cli) (built: Feb 23 2015 13:12:45)
/usr/local/php5.6/bin/php  =>  PHP 5.6.6 (cli) (built: Feb 23 2015 13:13:02)
/usr/local/php7.0/bin/php =&gt; PHP 7.0.0 (cli) (built: Dec 4 2015 11:04:38) ( NTS )
@shulard
shulard / dnsmasq.sh
Last active March 3, 2020 14:05
Script d'installation et configuration de DNSMasq sur Mac OS pour rediriger tous les .localhost vers 127.0.0.1
#Installation avec Homebrew
brew update
brew install dnsmasq
#Mise en place de la configuration et ajout des règle
cp $(brew list dnsmasq | grep /dnsmasq.conf.example$) /usr/local/etc/dnsmasq.conf
sed -i '' -e "/\#address=\/double-click\.net\/127\.0\.0\.1/a\\
address=/.localhost/127.0.0.1" /usr/local/etc/dnsmasq.conf
#Démarrage du daemon
@shulard
shulard / disclaimer.xml
Last active May 2, 2016 14:07
How to use the `xi:include` tag in XML files...
<?xml version='1.0'?>
<disclaimer>
<p>The opinions represented herein represent those of the individual
and should not be interpreted as official policy endorsed by this
organization.</p>
</disclaimer>