This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body class="demo-1 loading"> | |
<main> | |
<div class="message">Some message for mobile (if needed).</div> | |
<div class="frame"> | |
<div class="frame__title-wrap"> | |
<h1 class="frame__title">rgbKineticSlider</h1> | |
<p class="frame__tagline">Demo 2</a></p> | |
</div> | |
<div class="frame__links"> | |
<a href="https://github.com/hmongouachon/rgbKineticSlider">View this project on GitHub</a> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -------------------------------- using numpy | |
from __future__ import print_function | |
import math | |
import numpy as np | |
from numpy import trapz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from app.config import TWITTER_APP_KEY, TWITTER_APP_SECRET | |
twitter_oauth = oauth.remote_app( | |
'twitter', | |
consumer_key=TWITTER_APP_KEY, | |
consumer_secret=TWITTER_APP_SECRET, | |
base_url='https://api.twitter.com/1.1/', | |
request_token_url='https://api.twitter.com/oauth/request_token', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function drawImageProp(ctx, img, x, y, w, h, offsetX, offsetY) { | |
if (arguments.length === 2) { | |
x = y = 0; | |
w = ctx.canvas.width; | |
h = ctx.canvas.height; | |
} | |
// default offset is center | |
offsetX = typeof offsetX === "number" ? offsetX : 0.5; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$(window).load(function() { | |
//Track Downloads | |
$('a').filter(function() { | |
return this.href.match(/.*\.(zip|mp3*|mpe*g|pdf|docx*|pptx*|xlsx*|rar*)(\?.*)?$/); | |
}).click(function(e) { | |
ga('send','event', 'download', 'click', this.href); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
ga('require', 'ecommerce'); | |
ga('ecommerce:addTransaction', { | |
'id': '[Transaction ID]', // Transaction ID. Required. | |
'affiliation': 'DUKES Hotel', // Affiliation or store name. | |
'revenue': '[11.99]', // Grand Total. | |
'shipping': '0', // Shipping. | |
'tax': '[1.29]' // Tax. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro render_pagination(pagination) %} | |
<nav class="pagination"> | |
{% if pagination.has_prev %} | |
<a class="prev" href="{{ url_for_other_page(pagination.page -1)}}"> | |
< Previous | |
</a> | |
{% endif %} | |
{%- for page in pagination.iter_pages() %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PER_PAGE = 30 | |
def records_for_page(page=1): | |
results = Property.objects.filter.order_by('-date').skip((page-1)*PER_PAGE).limit(PER_PAGE) | |
count = Property.objects.filter.order_by('-date').skip((page-1)*PER_PAGE).limit(PER_PAGE).count() | |
return count, results | |
@bp_public.route('/',defaults={'page':1},methods=['GET']) | |
@bp_public.route('/page/<int:page>') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PER_PAGE = 30 | |
def records_for_page(page=1): | |
return Property.objects.filter.order_by('-date').skip((page-1)*PER_PAGE).limit(PER_PAGE) |
NewerOlder