Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
from time import mktime
import json
from human_curl.async import AsyncClient
success_count = 0
fail_count = 0
Hello world
#include <stdio.h>
int main(void)
{
int i, n=20;
for(i = 0 ; i<n ; i--)
printf("*");
return 0;
}
# -*- coding: utf-8 -*-
"""
djangojinja2
~~~~~~~~~~~~
Adds support for Jinja2 to Django.
Configuration variables:
======================= =============================================
@Lispython
Lispython / gist:767961
Created January 6, 2011 14:50
Python simple MapReduce
def map_fn(i_list):
return [[x, 1] for x in i_list]
def reduce_fn(i):
return [i[0], sum(i[1])]
def sort_fn(i_list):
new = defaultdict(list)
map(lambda x: new[x[0]].append(x[1]), i_list)
return new.items()