Skip to content

Instantly share code, notes, and snippets.

View maplethorpej's full-sized avatar

Jerad Maplethorpe maplethorpej

View GitHub Profile
@maplethorpej
maplethorpej / react-pagination.js
Created May 31, 2018 17:25
Basic React pagination component.
import React, { Component } from 'react'
class Pagination extends Component {
render () {
const {totalPages, currentPage, selectFn} = this.props
if (totalPages <= 1) {return null}
const pages = Array.from({length: totalPages}, (v, k) => k + 1)
@maplethorpej
maplethorpej / nomics-api.py
Created May 1, 2018 02:06
A Python wrapper around the Nomics API.
import requests
class Nomics:
base_url = 'https://api.nomics.com/v1'
api_key = None
def __init__(self, api_key):
self.api_key = api_key
@maplethorpej
maplethorpej / Requester.py
Created April 3, 2018 16:56
Validate date parameters sent in a request object using either custom start/end dates or predefined periods. Raise exception if invalid. Python 3.
import datetime
import re
class Requester:
start = None
end = None
now = datetime.date.today()
default_period = {
Verifying my Blockstack ID is secured with the address 19zu7s3xsWjvNpp7j1jaZA7AQe6RSETVzL https://explorer.blockstack.org/address/19zu7s3xsWjvNpp7j1jaZA7AQe6RSETVzL
@maplethorpej
maplethorpej / vertical_slider_fade_gradient.js
Created March 25, 2017 18:56
jQuery-based vertical rotation slider with fade gradient
function subjectCrawl() {
var $list = $('.subject-crawl ul');
var itemHeight = $list.children('li:first').height();
var listLength = $list.children().length;
// position center item
$list.css('top', -(($list.height() - itemHeight) / 2));
scrollList();
@maplethorpej
maplethorpej / routes.py
Last active March 4, 2017 22:05
Wildcard route for .well-known SSL verification
# wildcard route for ssl verification
@app.route('/', defaults={'path': ''})
@app.route('/.well-known/<path:path>')
def ssl_cert(path):
return render_template('.well-known/' + path)

Keybase proof

I hereby claim:

  • I am maplethorpej on github.
  • I am maplethorpej (https://keybase.io/maplethorpej) on keybase.
  • I have a public key whose fingerprint is 6720 6C54 FAF3 D5C9 E76C AD1B 5344 67BE 0E22 74FE

To claim this, I am signing this object:

Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/arstechnica.com/posts/?f=json&metric=visitors&minutes=today&limit=15
Django Version: 1.9.8
Python Version: 2.7.10
Installed Applications:
['account',
@maplethorpej
maplethorpej / tandem.js
Created August 6, 2015 15:52
Super Simple Navigation-based jQuery Slider
var navigation = {
setup: function ($container) {
this.onChange($container);
},
onChange: function ($container) {
var $nav = $container.find('.nav li'),
$content = $container.find('.content li');
$nav.on('click', function () {
@maplethorpej
maplethorpej / gist:b7c93ad4d1610f22fe18
Created February 20, 2015 17:11
SCSS Grid Framework | Tables & Floats
.table {
display: table;
width: 100%;
.cell {
display: table-cell;
&.bottom {
vertical-align: bottom;
}
&.top {
vertical-align: top;