Skip to content

Instantly share code, notes, and snippets.

View micaleel's full-sized avatar
:octocat:
I may be slow to respond.

Khalil micaleel

:octocat:
I may be slow to respond.
View GitHub Profile
@wesm
wesm / gist:3831420
Created October 4, 2012 04:10
Parser shootout
# pylint: disable=W0612
import time
import pandas as pd
import numpy as np
import iopro
import gc
@seshness
seshness / HowToSharedRepoModelOnGitHub.md
Created October 24, 2012 01:45
Shared Repository Model for Pull Requests and Code Review

The Shared Repository Model

$ git clone [email protected]:berkeley-food-recommendations/data-gathering.git

You're cloning the main repository - be careful! We're going to enforce a "no committing to master directly" rule, so no committing directly to master, please.

Short Version

@fnielsen
fnielsen / afinn.py
Last active December 24, 2024 06:31
Simplest sentiment analysis in Python with AFINN
#!/usr/bin/python
#
# (originally entered at https://gist.github.com/1035399)
#
# License: GPLv3
#
# To download the AFINN word list do:
# wget http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/6010/zip/imm6010.zip
# unzip imm6010.zip
#
@ndarville
ndarville / business-models.md
Last active June 13, 2025 01:26
Business models based on the compiled list at http://news.ycombinator.com/item?id=4924647. I find the link very hard to browse, so I made a simple version in Markdown instead.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
@shlomibabluki
shlomibabluki / gist:4524141
Last active April 10, 2023 03:53
Backtracking Maze
public class Maze {
public int counter = 0;
public char[][] maze =
{{'#', '#', '#', '#', '#', '#', '#', '#', '#', '#'},
{'#', ' ', ' ', ' ', '#', ' ', '#', ' ', ' ', '#'},
{'#', ' ', ' ', ' ', '#', ' ', '#', ' ', '#', '#'},
{'#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'},
{'#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'},
@shlomibabluki
shlomibabluki / gist:4524155
Created January 13, 2013 13:37
Backtracking Maze Best
public class Maze_Best {
public int counter = 0;
private final static int MAX_VALUE = 1000;
int best_solution = MAX_VALUE;
public char[][] maze =
{{'#', '#', '#', '#', '#', '#', '#', '#', '#', '#'},
{'#', ' ', ' ', ' ', '#', ' ', '#', ' ', ' ', '#'},
@bradmontgomery
bradmontgomery / count_words.py
Last active August 15, 2022 19:11
playing with python's `collections.Counter`
"""
Use a Counter to find the most common words in "The Wonderful Wizard of Oz" by
L. Frank Baum.
Available in (mostly) plain text at:
https://archive.org/stream/wonderfulwizardo00baumiala/wonderfulwizardo00baumiala_djvu.txt
Note: This code also counts the words in the header, so it's not a *realistic*
applicaton, but more of a demonstration of python's Counter.
@glamp
glamp / pandas_plyr.py
Last active December 13, 2015 20:18
import numpy as np
import pandas as pd
import pylab as pl
baseball = pd.read_csv("http://bit.ly/144sh7t")
# group by year and get a summary of each numeric column
baseball.groupby(["year"]).describe()
# for each year, get the mean of each column
baseball.groupby(["year"]).aggregate(np.mean)
from dateutil.parser import parse
import pandas as pd
# monthly slaughter records since 1921
df = pd.read_csv("http://bit.ly/119792b")
# parse the data (we could also use pd.to_datetime)
df.date = df.date.apply(parse)
# sort the data frame by date
df = df.sort(['date'])
# create an index
@damianavila
damianavila / remove_output.py
Created April 3, 2013 22:05
Remove output from IPython notebook from the command line (dev version 1.0)
"""
Usage: python remove_output.py notebook.ipynb [ > without_output.ipynb ]
Modified from remove_output by Minrk
"""
import sys
import io
import os
from IPython.nbformat.current import read, write