Skip to content

Instantly share code, notes, and snippets.

@shreeshga
shreeshga / gist:1195310
Created September 5, 2011 15:52
When easy_install/pip fails with "Broken Pipe" Error on MacOSX
env ARCHFLAGS="-arch i386" pip install
or
env ARCHFLAGS="-arch i386" easy_install
@shreeshga
shreeshga / disable_arrows.vimrc
Created September 7, 2011 00:17
vimrc commands to disable arrow key navigation
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
% resume.tex
%
% (c) 2002 Matthew Boedicker <mboedick@mboedick.org> (original author) http://mboedick.org
% (c) 2003 David J. Grant <dgrant@ieee.org> http://www.davidgrant.ca
% (c) 2007 Todd C. Miller <Todd.Miller@courtesan.com> http://www.courtesan.com/todd
% (c) 2009 Derek R. Hildreth <derek@derekhildreth.com> http://www.derekhildreth.com
% (c) 2011 Shreesh Ayachit <shreesh.ayachit@gmail.com>
%This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/1.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
% GENERAL NOTE: There may be some notes specific to myself. If you're only interested in my LaTeX source or it doesn't make sense, please disregard it.
@shreeshga
shreeshga / gist:1341151
Created November 5, 2011 05:33
Python unicode pickle error
To solve the below error:
global name '__str__' is not defined
Decode the NavigableString to str and decode to utf-8
ldict['anchor'] = str(link.string).decode('utf-8')
@shreeshga
shreeshga / example1.py
Created November 16, 2011 23:16 — forked from onyxfish/example1.py
Basic example of using NLTK for name entity extraction.
import nltk
with open('sample.txt', 'r') as f:
sample = f.read()
sentences = nltk.sent_tokenize(sample)
tokenized_sentences = [nltk.word_tokenize(sentence) for sentence in sentences]
tagged_sentences = [nltk.pos_tag(sentence) for sentence in tokenized_sentences]
chunked_sentences = nltk.batch_ne_chunk(tagged_sentences, binary=True)
@shreeshga
shreeshga / vimrc
Created November 29, 2011 18:09
my vim config file
" This uses Vundle (https://github.com/gmarik/vundle) to manage vim scripts
" syntax highlight
syntax on
" Mouse support
set mouse=a
" Code Header
autocmd bufnewfile *.py so ~/.vim/py_header.txt
autocmd bufnewfile *.h,*.hpp,*.c,*.cpp so ~/.vim/c_header.txt
@shreeshga
shreeshga / eclipse.ini
Created December 19, 2011 22:20
eclipse Java Heap Error
-vmargs
-Xms512m
-Xmx1024m
-XX:+UseParallelGC
-XX:PermSize=256M
-XX:MaxPermSize=512M
@shreeshga
shreeshga / hyde2rst.py
Created January 16, 2012 06:27
python code to convert from hyde blog to rst format
"""
* Creation Date : 14-01-2012
* Last Modified :
* Created By : Shreesh Ayachit (shreesh.ayachit@gmail.com)
* Description :
"""
import os
import sys
import re
from subprocess import call
@shreeshga
shreeshga / gist:1627145
Created January 17, 2012 15:45
md5sum through brew
brew install md5sha1sum
@shreeshga
shreeshga / make-eclipse-projects.bash
Created March 28, 2012 04:03 — forked from ibrahima/make-eclipse-projects.bash
Bash script to generate eclipse projects for all ROS projects in the current directory
#!/usr/bin/env bash
echo "Generating eclipse projects for all ROS projects in this directory"
for MKFILE in `find $PWD -name Makefile`; do
DIR=`dirname $MKFILE`
echo $DIR
cd $DIR
make eclipse-project
done