Skip to content

Instantly share code, notes, and snippets.

View Plou's full-sized avatar

Plou Plou

View GitHub Profile
@Plou
Plou / npm-registry.md
Created February 18, 2014 08:52
Using the European npm mirror

Using the European npm mirror

To install :

npm install --registry http://registry.npmjs.org packagename

To keep using the European registry :

This will update your .npmrc to include the following line registry = http://registry.npmjs.eu/

npm config set registry http://registry.npmjs.eu

@Plou
Plou / jquery.browser.js
Created December 3, 2013 10:20
Add the depreciated object browser object to jquery (for compability issue solving only)
jQuery.uaMatch = function( ua ) {
ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
/(msie) ([\w.]+)/.exec( ua ) ||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
[];
@Plou
Plou / commit.diff
Created December 3, 2013 08:21
Split Grunt config into per-task files.
https://github.com/cowboy/wesbos/commit/5a2980a7818957cbaeedcd7552af9ce54e05e3fb
@Plou
Plou / jScroll.js
Created September 25, 2013 14:13
Detect and fire scrollDown & scrollUp events
(function($) {
// ## Detect and fire scrollDown & scrollUp events
var lastScrollTop = $(window).scrollTop();
$(window).scroll(function(){
var current = $(this).scrollTop();
// Check the direction of the scroll
if (current >= lastScrollTop){
// Trigger the down scroll event
$(this).trigger('jScroll.down');
// Detect a change of direction
@Plou
Plou / links
Created September 25, 2013 09:14
An htc behaviour to enable cover and contain background size on ie8
@Plou
Plou / ReadMe.textile
Created September 12, 2013 12:19
A Javascript library to show side contents (like responsive menu)

jQuery PageSlide

PageSlide is a jQuery plugin which slides a webpage over to reveal an additional interaction pane.

Demo

There are a couple of examples included with this package. Or, if you can’t wait to download it, see it live on the responsive demo or original project page.

Options

@Plou
Plou / upgrade_subl.sh
Created September 4, 2013 13:11
Allow to upgrade sublime-text from a deb url
cd /home/cplou/Téléchargements/ && wget [url] && sudo dpkg -i sublime-text_build-3*.deb
@Plou
Plou / 3drendering.css
Created August 27, 2013 15:38
Enable 3D rendering when available to improve transitions (work with javascript animations). Using it on text elements may cause bad font rendering.
.selector {
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
-o-transform: translateZ(0);
transform: translateZ(0);
}
@Plou
Plou / template.html
Created August 16, 2013 14:38
How to use any available field in tt_news for any display code. bellow an example of "news_files" use.
<!-- ###TEMPLATE_LIST### begin -->
<!-- ###CONTENT### begin -->
<!-- ###NEWS### begin -->
[---]
<div class="download">
###FILE_LINK###
</div>
[---]
<!-- ###NEWS### end-->
<!-- ###CONTENT### end -->
@Plou
Plou / command.sh
Created August 14, 2013 13:00
Allow to set a max download rate to limit bandwith consumption to any port
// set max down rate to 625 Kb/s on ssh port (git : 9418)
sudo ipfw pipe 1 config bw 5000KByte/s
sudo ipfw add 1 pipe 1 src-port 22
// delete the rule
sudo ipfw delete 1