Skip to content

Instantly share code, notes, and snippets.

View eleweek's full-sized avatar

Alexander Putilin eleweek

  • London
View GitHub Profile
# The code was used to generate this AskReddit comment: https://www.reddit.com/r/AskReddit/comments/3bqwxi/what_are_some_of_the_must_watch_comedy_movies/csp4bzo
import imdb
ia = imdb.IMDb()
def movie_has_data(movie):
try:
# checking e.g. ('rating' in movie) always returns False
# maybe there is a better way to check data availability
@eleweek
eleweek / agar.py
Created April 30, 2015 19:32
m.agar.io
from datetime import timedelta
from flask import make_response, request, current_app
from functools import update_wrapper
from flask import Flask
def crossdomain(origin=None, methods=None, headers=None,
max_age=21600, attach_to_all=True,
automatic_options=True):
if methods is not None:
@eleweek
eleweek / rttmpl.cpp
Created April 29, 2015 23:48
Runtime template instantiation :)
#include <iostream>
#include <fstream>
#include <vector>
#include <dlfcn.h>
#define FOO_INTERFACE \
class FooInterface \
{ \
public: \
virtual void bar() = 0; \
@eleweek
eleweek / gist:f2dcc12b2e047a4114e4
Created April 27, 2015 01:10
Slow Sudoku Solver (it looks like it works)
#include <iostream>
#include <string>
#include <vector>
#include <set>
const int SIZE = 9;
typedef std::vector< std::vector<int> > Matrix;
Matrix read_puzzle()
diff --git a/indexer.py b/indexer.py
index 579f95b..bcdbacc 100755
--- a/indexer.py
+++ b/indexer.py
@@ -8,6 +8,8 @@ import shelve
import math
from progressbar import ProgressBar, Percentage, Bar, RotatingMarker
import workaround
+import gc
+from guppy import hpy
iff --git a/indexer.py b/indexer.py
index 579f95b..bcdbacc 100755
--- a/indexer.py
+++ b/indexer.py
@@ -8,6 +8,8 @@ import shelve
import math
from progressbar import ProgressBar, Percentage, Bar, RotatingMarker
import workaround
+import gc
+from guppy import hpy
" All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just
" /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime
" you can find below. If you wish to change any of those settings, you should
" do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten
" everytime an upgrade of the vim packages is performed. It is recommended to
" make changes after sourcing debian.vim since it alters the value of the
" 'compatible' option.
" This line should not be removed as it ensures that various options are
" properly set to work with the Vim-related packages available in Debian.
@eleweek
eleweek / -
Created January 12, 2015 20:45
From 31ac05d8f44ab6601a2536cce949bd4938107ed3 Mon Sep 17 00:00:00 2001
From: Franklin Delehelle <franklin@odena.eu>
Date: Sat, 22 Nov 2014 18:44:40 +0100
Subject: [PATCH] Compile with OS X 10.10
Fixes the OS X version detection regex to allow compiling under OS X
10.10+.
---
cmake/Config.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- cmake/Config.cmake.original 2014-12-28 14:17:21.000000000 +0300
+++ cmake/Config.cmake 2014-12-28 14:53:30.000000000 +0300
@@ -1,71 +1,71 @@
-
-# detect the OS
-if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
- set(WINDOWS 1)
-
- # detect the architecture (note: this test won't work for cross-compilation)
- include(CheckTypeSize)
@eleweek
eleweek / test.txt
Created December 30, 2014 20:21
Created using curl
test
line2
line3
line4