Skip to content

Instantly share code, notes, and snippets.

View mickeypash's full-sized avatar
🐒
slow and steady wins the race

Mickey Pashov mickeypash

🐒
slow and steady wins the race
View GitHub Profile
@mickeypash
mickeypash / search_book.py
Last active August 29, 2015 14:25
Scraping practice.
#!/usr/bin/env python
import requests
from bs4 import BeautifulSoup
def make_soup(url):
r = requests.get(url)
soup = BeautifulSoup(r.content, 'lxml')
return soup
@mickeypash
mickeypash / pythonic.py
Created July 26, 2015 22:24
My solution is in the comments
def getQueryResultPerformance(results, topic_num):
i = 0
rels_found = 0
for r in results:
i += 1
if qrels.get_value(topic_num, r.docid) > 0:
rels_found += 1
# rels_found = sum(qrels.get_value(topic_num, r.docid) > 0 for r in results)
# return [rels_found, len(results)]
@mickeypash
mickeypash / document2.html
Created August 9, 2015 16:05
document for the wildlife query
<p>
KITENGELA, Kenya _ On a clear day, Agnes Patita can see the
tourists in vans inching along dirt roads, searching the plains for
antelope, zebra, giraffe and, if they are lucky, an elusive pride
of lions.
</p><p>
But the majestic cats the tourists pay to see are dangerous
pests to Mrs. Patita. Lions have killed more than 20 cattle here in
the last two months. On a recent night, two lions broke into the
@mickeypash
mickeypash / treconomics.py
Created August 20, 2015 12:15
This problem occurs when participants attempt to view a document.
Environment:
Request Method: GET
Request URL: http://ede1a05.ngrok.com/treconomics/391485/
Django Version: 1.7
Python Version: 2.7.10
Installed Applications:
('django.contrib.auth',
@mickeypash
mickeypash / analysis.ipynb
Created August 29, 2015 17:43
Trying to create some of the suggested graphs.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mickeypash
mickeypash / web-whatsapp.js
Created May 7, 2016 21:35
This is the javascript process running the web client for whatsapp
This file has been truncated, but you can view the full file.
/*! Copyright (c) 2015 WhatsApp Inc. All Rights Reserved. */
webpackJsonp([84], [, function(e, t, r) {
"use strict";
function n() {
return u[Math.round(Math.random() * (u.length - 1))]
}
function o() {
this.logs = [], this.localCursor = 0, this.pending = void 0, this.timer = new d(this, this.persistIdb)
import requests
mickey_ch_id = 'UCyHQxCUs1ENbnj36FjesG7Q'
marc_ch_id = 'UCzhG6dIYhenVoRVgcdUexLQ'
stoyan_ch_id = 'stoyanjr'
base_url = 'https://www.googleapis.com/youtube/v3/'
path = 'subscriptions?part=id&channelId=UCyHQxCUs1ENbnj36FjesG7Q&fields=items%2Fid&key='
full_path = '{0}{1}{2}'.format(base_url, path, API_KEY)
@mickeypash
mickeypash / game-of-life.py
Created July 10, 2016 10:20
Conway's Really Simple Game of Life based on ("Stop Writing Classes" PyCon 2012)[https://www.youtube.com/watch?v=o9pEzgHorH0]
import itertools
# Conway's Really Simple Game of Life based on "Stop Writing Classes" PyCon 2012
def neighbors(point):
x,y = point
yield x + 1, y
yield x - 1, y
yield x, y + 1
yield x, y - 1

Mickey's Guide to Glasgow

Flat hunting

  • Where to buy appliances and furniture from? Argos, IKEA
  • How to find the right flat?

Cell phone providers

Python 3 hrs 18 mins β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 60.3%
Git 30 mins β–ˆβ–‰β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 9.2%
YAML 26 mins β–ˆβ–‹β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 8.0%
Markdown 21 mins β–ˆβ–β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 6.6%
Text 15 mins β–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 4.9%