Skip to content

Instantly share code, notes, and snippets.

View danjac's full-sized avatar

Dan Jacob danjac

  • Finland
  • 02:39 (UTC -12:00)
View GitHub Profile
package main
import (
"net/http"
"net/http/httputil"
"net/url"
)
func main() {
import requests
url = "http://letsrevolutionizetesting.com/challenge"
while True:
data = requests.get(url, headers={"Accept":"application/json"})
json = data.json()
print(json)
if 'follow' in json:
url = json['follow']
"""
Join us at pitch x. x is a number between 1 and 553 such that the sum of
x's divisors (not including x) is greater than x but no subset of x's
divisors add up to exactly x
Run on Python 3.4.3
tl;dr; result was 70
"""
import itertools
{% extends "talent_solution/base_landing_page.html" %}
{% load talent_solution_tags %}
{% block header_img %}some_crappy_banner.png{% endblock %}
{% block header title %}Wow a new landing page{% endblock %}
{% block carousel %}
{# normally this is just DB-driven...#}
{% carousel 5 6 "blah" %}
{% endblock %}
@danjac
danjac / gist:8477954
Created January 17, 2014 17:46
Integration of wtforms 2 and Pyramid, including CSRF stuff.
from webob.multidict import MultiDict
from wtforms import Form as BaseForm
from wtforms.csrf.core import CSRF as BaseCSRF
class Form(BaseForm):
def __init__(self, request, formdata=None, *args, **kwargs):
@danjac
danjac / gist:1315692
Created October 26, 2011 07:31
file upload
(ns file-uploadr.views.upload
(:require [file-uploadr.views.common :as common]
[noir.response :as res]
[noir.content.pages :as pages])
(:use noir.core
hiccup.core
hiccup.page-helpers
hiccup.form-helpers))
(defpage "/" []