Skip to content

Instantly share code, notes, and snippets.

{% if is_paginated %}
{% load i18n %}
<ul class="pagination">
<li{% if not page_obj.has_previous %} class="disabled"{% endif %}><a href="{% if not page_obj.has_previous %}#{% else %}?page={{ page_obj.previous_page_number }}{{ getvars }}{% endif %}">&laquo;</a></li>
{% if show_first %}
<li><a href="?page=1{{ getvars }}">1</a></li>
<li><span>...</span></li>
{% endif %}
@frenchy64
frenchy64 / schema.md
Created August 11, 2014 06:55
Schema vs core.typed

Schema

I think of Schema as a runtime contracts library (I believe it does coercion and validation, but they seem related to me).

Pros

  • small barrier to entry, thus immediately useful
    • just add a contract/coercion to a function and you're off
  • can manipulate contracts as regular clojure data
  • documentation
@borkdude
borkdude / gist:38969e4495f2192b4388
Created February 16, 2015 07:41
Plant based (vegan) whole food low fat recipes
Recipe websites:
http://www.straightupfood.com/
http://www.healthyveganlife.com/
http://www.plantbasedchristian.com/
http://happyherbivore.com/
http://klunkerskitchen.blogspot.nl/
Youtube Channels with recipes:
@sjl
sjl / correct_shift_keys.xml
Created April 8, 2011 14:36
A snippet for KeyRemap4MacBook that will teach you to use the correct shift keys.
<list>
<item>
<name>Use the correct goddamed shift keys.</name>
<identifier>private.fucking_shift_keys_how_do_they_work</identifier>
<autogen>--KeyToKey-- KeyCode::Q, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::W, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::E, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::R, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
<autogen>--KeyToKey-- KeyCode::T, ModifierFlag::SHIFT_L, KeyCode::VK_NONE</autogen>
unless typeof exports is "undefined"
Spine = exports
else
Spine = @Spine = {}
Spine.version = "0.0.4"
$ = Spine.$ = @jQuery || @Zepto || -> arguments[0]
makeArray = Spine.makeArray = (args) ->
@minichate
minichate / gist:1713533
Created January 31, 2012 22:40
Progress Bar
count = len(entries)
for i, entry in enumerate(entries):
percent = math.ceil(100 * float(i) / float(count))
marks = math.floor(70 * (percent / 100.0))
spaces = math.floor(70 - marks)
updated_loader = '[' + ('=' * int(marks)) + (' ' * int(spaces)) + ']'
if not loader == updated_loader or loader is None:
sys.stdout.flush()
@jed
jed / LICENSE.txt
Created May 26, 2011 17:39 — forked from 140bytes/LICENSE.txt
get a supported XHR instance
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@azproduction
azproduction / LICENSE.txt
Created May 24, 2011 19:16 — forked from 140bytes/LICENSE.txt
Desktop browser detection script
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 azproduction
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@jed
jed / LICENSE.txt
Created May 10, 2011 16:04 — forked from 140bytes/LICENSE.txt
write contextual templates
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@bodil
bodil / hindley-milner.clj
Last active August 12, 2019 18:08
Port of http://dysphoria.net/code/hindley-milner/HindleyMilner.scala to 100% pure Clojure code, complete with state monad hell. Originally based on Luca Cardelli's paper "Basic Polymorphic Typechecking" http://lucacardelli.name/Papers/BasicTypechecking.A4.pdf
;;; Clojure port of http://dysphoria.net/code/hindley-milner/HindleyMilner.scala
(ns hindley-milner
(:require [clojure.string :as str]))
(declare occurs-in? occurs-in-type?)
(defn map-state
"Evaluate a list of state monad values in sequence, producing
a list of the results of each evaluation."