Skip to content

Instantly share code, notes, and snippets.

View matthieualouis's full-sized avatar

Matthieu Louis matthieualouis

  • Stepsize
  • London
View GitHub Profile
@matthieualouis
matthieualouis / ui_item.html
Last active April 6, 2016 09:30 — forked from jaredjburgess/ui_item.html
Semantic ui item in a div tag.
<div class="ui item">
<div class="content">
<div class="ui header"></div>
<div class="meta"></div>
<div class="description"></div>
</div>
</div>
@matthieualouis
matthieualouis / div_tag.html
Last active April 6, 2016 08:01 — forked from jaredjburgess/div_tag.html
Shortcut to create closed the div tags.
<div></div>
@matthieualouis
matthieualouis / script_tag_javascript.html
Created April 6, 2016 07:59 — forked from jaredjburgess/script_tag_javascript.html
Shortcut to create a closed javascript script tag.
<script type="text/javascript"></script>
@matthieualouis
matthieualouis / window_load.js
Last active April 6, 2016 08:58 — forked from jaredjburgess/window_load.js
JQuery window load.
$(window).load(function() {
// placeholder
});
@matthieualouis
matthieualouis / document_ready.js
Last active April 6, 2016 08:57 — forked from jaredjburgess/document_ready.js
JQuery document ready.
$(document).ready(function() {
// placeholder
});
/*dragon*/var b=X=Y=T=L=0;document.addEventListener("click",function(a){a.preventDefault()},!0);document.addEventListener("mousedown",c);document.addEventListener("touchstart",c);function c(a){a.preventDefault();a.target!==document.documentElement&&a.target!==document.body&&(b=Date.now(),a.target.setAttribute("data-drag",b),a.target.style.position="relative",T=a.target.style.top.split("px")[0]||0,L=a.target.style.left.split("px")[0]||0);X=a.clientX||a.touches[0].clientX;Y=a.clientY||a.touches[0].clientY}document.addEventListener("mousemove",d);document.addEventListener("touchmove",d);function d(a){if(""!==b){var e=document.querySelector('[data-drag="'+b+'"]');e.style.top=parseInt(T)+parseInt((a.clientY||a.touches[0].clientY)-Y)+"px";e.style.left=parseInt(L)+parseInt((a.clientX||a.touches[0].clientX)-X)+"px"}}document.addEventListener("mouseup",f);document.addEventListener("touchend",f);function f(){b=""}document.addEventListener("mouseover",g);function g(a){a.target.style.cursor="move";a.target.style.boxShado
@matthieualouis
matthieualouis / sqlalchemy_query_profiling.py
Last active February 12, 2016 13:39 — forked from nomeyer/sqlalchemy_query_profiling.py
Context manager to profile sqlalchemy query performance
import cProfile
import StringIO
import pstats
import contextlib
@contextlib.contextmanager
def profiled():
pr = cProfile.Profile()
pr.enable()