Skip to content

Instantly share code, notes, and snippets.

View hassanshamim's full-sized avatar

Hassan Shamim hassanshamim

  • Philadelphia, PA
View GitHub Profile
@hassanshamim
hassanshamim / capwords.py
Created October 10, 2017 12:48
capwords.py
def capwords(text, sep=None):
return (sep or ' ').join(word.capitalize() for word in text.split())
@hassanshamim
hassanshamim / capwords.py
Created October 10, 2017 12:48
capwords.py
def capwords(text, sep=None):
return (sep or ' ').join(word.capitalize() for word in text.split())
@hassanshamim
hassanshamim / example_cal.py
Last active September 1, 2017 02:28
Cal helper files
print(""" September 2017
Su Mo Tu We Th Fr Sa
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
""")
@hassanshamim
hassanshamim / example.py
Created December 14, 2016 02:20
example gist
print('hello world')

So just looking at your code a bit, I can’t run anything because I don’t have the data. An idea I had that might speed up the process:

Instead of your double for loop where you count the number of times each keyword apeears in the query, you could iterate over all the search queries and build a dictionary (or use counter module) to count the number of times each word appears in total.

# i.e.
@hassanshamim
hassanshamim / zombip.py
Last active October 11, 2016 00:29
zoombit or w/e it's called
# -*- coding: utf-8 -*-
"""
>>> process([[1, 2, 4], [5, 1, 4], [1, 2, 3]], (0,2), 4)
[[-1, -1, -1], [5, -1, -1], [-1, -1, -1]]
>>> process([[1, 3, 2], [1, 1, 4], [0, 4, 3]],(0,2), 3)
[[-1, -1, -1], [-1, -1, 4], [-1, 4, 3]]
>>> process([[1, 3, 2], [1, 1, 4], [0, 4, 3]],(0,0), 2)
@hassanshamim
hassanshamim / GetLucky
Last active August 29, 2015 14:08
pip install GetLucky
avendesora•~» pip install GetLucky [14:52:49]
Downloading/unpacking GetLucky
Downloading GetLucky-1.2.7.tar.gz (44kB): 44kB downloaded
Running setup.py egg_info for package GetLucky
Downloading/unpacking requests>=2.2.1 (from GetLucky)
Downloading requests-2.4.3.tar.gz (438kB): 438kB downloaded
Running setup.py egg_info for package requests
Downloading/unpacking beautifulsoup4>=4.3.2 (from GetLucky)
http://pcottle.github.io/learnGitBranching/
http://rogerdudler.github.io/git-guide/
http://think-like-a-git.net/
http://gitimmersion.com/
http://gitref.org/
http://git-scm.com/documentation
@hassanshamim
hassanshamim / notebook play
Created February 23, 2014 23:03
notebook play
{
"metadata": {
"name": "notebook play"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{