Skip to content

Instantly share code, notes, and snippets.

View capsulecorplab's full-sized avatar

Sean Marquez capsulecorplab

View GitHub Profile
@alexbowe
alexbowe / nltk-intro.py
Created March 21, 2011 12:59
Demonstration of extracting key phrases with NLTK in Python
import nltk
text = """The Buddha, the Godhead, resides quite as comfortably in the circuits of a digital
computer or the gears of a cycle transmission as he does at the top of a mountain
or in the petals of a flower. To think otherwise is to demean the Buddha...which is
to demean oneself."""
# Used when tokenizing words
sentence_re = r'''(?x) # set flag to allow verbose regexps
([A-Z])(\.[A-Z])+\.? # abbreviations, e.g. U.S.A.
@pazdera
pazdera / builder.py
Created August 2, 2011 20:35
Example of `builder' design pattern in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Example of `builder' design pattern
# Copyright (C) 2011 Radek Pazdera
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@rawwebdesign
rawwebdesign / gtd.markdown
Created January 4, 2012 22:14
What is Getting Things Done?

#What is Getting Things Done? Getting Things Done is a personal management framework that enables anyone to manage their obligations. GTD is unique in it's focus on clearing the mind to enabling creative thinking in times of stress.

Instead of explaining the step-by-step of GTD, let's look at the tenants that separate it from other personal productivity approaches:

##Actionability: The first question is: "Is this actionable?" Mental clutter comes from getting unactionable items mixed into your todo list. Unactionable items are treated differently and aren't placed on your todo list.

##Next Actions: The motto of GTD is: "What is the next action?". An example: A typical todo list might include: "Get Gym Membership". GTD encourages practicioners to break that into next actions. While "Get Gym Membership" is the goal, but what are the steps that get you there? The next action may be "Call 3 Local Gyms to Get Pricing". Which is more enticing when you look at your todo list?

@dupuy
dupuy / README.rst
Last active May 5, 2024 18:42
Common markup for Markdown and reStructuredText

Markdown and reStructuredText

GitHub supports several lightweight markup languages for documentation; the most popular ones (generally, not just at GitHub) are Markdown and reStructuredText. Markdown is sometimes considered easier to use, and is often preferred when the purpose is simply to generate HTML. On the other hand, reStructuredText is more extensible and powerful, with native support (not just embedded HTML) for tables, as well as things like automatic generation of tables of contents.

@attilaolah
attilaolah / imgcmp.py
Created February 29, 2012 11:30
Fast image comparison with Python
import math
import Image
import Levenshtein
class BWImageCompare(object):
"""Compares two images (b/w)."""
_pixel = 255
@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active May 14, 2024 18:19
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request:
@tetsuok
tetsuok / answer_pic.go
Created April 2, 2012 02:40
An answer of the exercise: Slices on a tour of Go
package main
import "code.google.com/p/go-tour/pic"
func Pic(dx, dy int) [][]uint8 {
// Allocate two-dimensioanl array.
a := make([][]uint8, dy)
for i := 0; i < dy; i++ {
a[i] = make([]uint8, dx)
}
@hoeltgman
hoeltgman / org-syntax-cheatsheet.org
Created October 3, 2012 06:32 — forked from wdkrnls/org-syntax-cheatsheet.org
Org-mode Syntax Cheat sheet

org-syntax-cheatsheet.org

@yuanmai
yuanmai / gist:4411286
Created December 30, 2012 06:40
remove all elc files in your emacs folders
find . -name "*.elc" -type f | xargs rm -f
@dandrews
dandrews / dto-org-gtd.el
Created January 26, 2013 21:19
David O'Toole's org-mode configuration for Getting Things Done
;;; dto-org-gtd.el --- dto's org-mode configuration for GTD
;;; http://orgmode.org/worg/code/elisp/dto-org-gtd.el
;; Copyright (C) 2007 David O'Toole
;; Author: David O'Toole(require 'org) <dto@gnu.org>
;; Keywords: tools
;; This file is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by