Skip to content

Instantly share code, notes, and snippets.

Maxime Dantec Warry

Block or report user

Report or block Warry

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Warry
Warry / Refresh yourCSS: Bookrmarklet
Created Oct 27, 2010
Modify +R shortcut to refresh only the CSS files
View Refresh yourCSS: Bookrmarklet
javascript:void(function(){window.addEventListener("keydown",function(e){if(e.metaKey && e.keyCode==82){e.preventDefault();var i,a,s;a=document.getElementsByTagName('link');for(i=0;i<a.length;i++){s=a[i];if(s.rel.toLowerCase().indexOf('stylesheet')>=0 && s.href){var h=s.href.replace(/(&amp;|%5C?)forceReload=d+/,'');s.href=h+(h.indexOf('?')>=0?'&amp;':'?')+'forceReload='+(new Date().valueOf())}}return false}})})();
View README.md

XRefresh for Chrome

Deprecated! Use LiveReload instead.

via xrefresh#17

How to use

  • ruby ws_dir_watcher.rb ~/my_site
  • Open chrome://extensions/
  • "Developer mode", then press "Load unpacked extension" button
@Warry
Warry / gist:2362973
Created Apr 11, 2012
My thoughts about meteor.js
View gist:2362973

Lately, with the help of Julien Tournay, I wondered how can we resolve the model problem in the browser which is : there is no ONE true model, and one information can be duplicated in multiple places (eg: form, list, item). Finally, I found out that the real datas are from : the forms > the server > the DOM. Meteor solved this by keeping this order, and synchronize it all in real time ! That's truly great. But. There a hudge cost in this : you have an heavy fullstack architecture, and you can't have control on the async which is black magic. Also, It's made for realtime, so concurrency apps. With Node.js in one thread, I can't imagine an app with thousands of users at the same time managing as much states properly. There is no holly grail. Just code!

View gist:3890290
Monitor is a simple HTML/JS based application. It allows requesting JSON apis, with an history.
This gist is used to try the demo requests on start.
@Warry
Warry / Article.md
Created Dec 11, 2012
How to make faster scroll effects?
View Article.md

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:

@Warry
Warry / demo.wooot.coffee
Last active Dec 22, 2015
Demo of wOOOt api
View demo.wooot.coffee
Todos =
# public properties
list: OOO.observableArray([])
# public methods
counter: OOO.computed ()->
@list.length + " remaining todos"
clear: ()->
@list.remove (_)-> _.done
@Warry
Warry / stylus-shell.js
Last active Aug 29, 2015
sbt-we plugin workflow
View stylus-shell.js

We'll take the stylus plugin as an exemple.

Making it work with Node.js

To make our plugin to work with node, we are going to use Christopher's js-transpiler. It allows to develop a shell script that will work independtly on both node and the jvm. You can call a shell script from the cli like this:

    node my-shell.js file.extension '{"flag":true}'

You can use this to debug your processor until it works!

@Warry
Warry / README.md
Last active Aug 29, 2015
Runtime Type Checker in JS
View README.md

Runtime Type checker in JS.

is(String, "foo") // true
is(/foo/, "foo") // true
is("foo", "foo") // true

// See test file for more exemples...
View gist:829f9e970087567ac64c
### Keybase proof
I hereby claim:
* I am warry on github.
* I am warry (https://keybase.io/warry) on keybase.
* I have a public key whose fingerprint is E875 F7BA 4FB3 FE3A E55B 8E48 91FA 985A B75E 490A
To claim this, I am signing this object:
View gist:1472519278124015ac7d
interface Functor<A>{
flatMap<A,B> (f: (A) => B): Functor<B>
}
interface Monad<A> extends Functor<A> {
bind: (A) => Monad<A>
}
interface Option<A> extends Monad<A>{
}
You can’t perform that action at this time.