Skip to content

Instantly share code, notes, and snippets.


J. Tangelder jtangelder

Block or report user

Report or block jtangelder

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
View inview.js
* triggers a callback when an element gets into the viewport
* uses a little bit of jQuery. elements auto receive the class `inview`
* the threshold parameter is on scale from 0 to 1 of the height.
* 0 means it triggers directly, 1 means it must be full visible
* @example
* // images needs to be 50% in view
* inview.register("img", .5, function(item, inview_state) {
View slideshow.scss
* @example
* div.slideshow
* div first pane
* active pane
* div last pane
.slideshow {
position: relative;
overflow: hidden;
View IE.js
var IE = (function() {
if (document.documentMode) {
return document.documentMode;
} else {
for (var i = 7; i > 4; i--) {
var div = document.createElement("div");
div.innerHTML = "<!--[if IE " + i + "]><span></span><![endif]-->";
if (div.getElementsByTagName("span").length) {
jtangelder / example
Last active Aug 29, 2015
View example
<!DOCTYPE html>
<head lang="en">
<meta charset="UTF-8">
jtangelder / django.jquery.polyfill.js
Last active Aug 29, 2015
django.jQuery 1.4.2 upgrade functions to support some 'newer' jQuery methods.
View django.jquery.polyfill.js
(function(jQuery) {
if(!jQuery) {
var $version = jQuery.prototype.jquery;
* find out if a version number is greater then or equal (>=) as the compare version
* @example
jtangelder /
Last active Nov 7, 2015
CLI teletekst.
import urllib.request
import urllib.error
import json
import re
import cmd
import html
def getTeletekstPage(page):
url = '' % (page)
res = urllib.request.urlopen(url)
jtangelder /
Last active Dec 21, 2015
hack jQuery to use requestAnimationFrame for animations
# hack jQuery to use requestAnimationFrame for animations
((win, $)->
# use Modernizr to get the (prefixed)DOM method
raf = Modernizr.prefixed('requestAnimationFrame', win)
if not raf
animating = false;
View modernizr.positionfixed.js
;(function(Modernizr, window) {
Modernizr.addTest('positionfixed', function () {
var ret;
// no (solid) support on <Android2 and <iOS4
var ua = navigator.userAgent;
if(ua.match(/android [0-2]/i) || ua.match(/(iphone|ipad|ipod).+(OS [0-4])/i)) {
return false;

Keybase proof

I hereby claim:

  • I am jtangelder on github.
  • I am jtangelder ( on keybase.
  • I have a public key ASCKQzxwTobC0hWn_XhXcj4xV7vaufd6s1ZVFlhlNF4Mbgo

To claim this, I am signing this object:

jtangelder / createResource.js
Last active Mar 20, 2016
Redux resources, untested
View createResource.js
Create (cacheable) resources, and endpoints that require some state that you want to hide from the
arguments, like a JWT for authenticating remote calls.
Returns a function that will be accepted by redux-thunk.
* create a redux-resource function
* @param {Function} remote(args, getState)
You can’t perform that action at this time.