Skip to content

Instantly share code, notes, and snippets.

@yxnino
yxnino / paginate.html
Created May 29, 2016 07:50 — forked from honmaple/paginate.html
flask use paginate
{% macro paginate(pagination, endpoint,kw=None) %}
<ul class="pagination" style="margin:0">
{% if pagination.items and pagination.pages > 1 -%}
{%- if pagination.has_prev -%}
{%- if not kw -%}
<li><a href="{{ url_for(endpoint,page=pagination.page-1)}}" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
{%- else -%}
<li><a href="{{ url_for(endpoint,page=pagination.page-1,**kw)}}" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
{% endif -%}
{%- else %}
@yxnino
yxnino / vunits.js
Created March 24, 2016 03:04 — forked from LeaVerou/vunits.js
Static polyfill for vw, vh, vm units
/**
* Polyfill for the vw, vh, vm units
* Requires StyleFix from -prefix-free http://leaverou.github.com/prefixfree/
* @author Lea Verou
*/
(function() {
if(!window.StyleFix) {
return;
// Log Angular exceptions to Sentry
$provide.decorator('$exceptionHandler', function($delegate) {
return function(exception, cause) {
$delegate(exception, cause);
Raven.captureException(exception, {
extra: {
cause: cause,
member_email: member.email
}
});
@yxnino
yxnino / rAF.js
Created October 14, 2015 14:10 — forked from paulirish/rAF.js
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];