Skip to content

Instantly share code, notes, and snippets.

@mblondel
mblondel / lda_gibbs.py
Last active October 9, 2023 11:31
Latent Dirichlet Allocation with Gibbs sampler
"""
(C) Mathieu Blondel - 2010
License: BSD 3 clause
Implementation of the collapsed Gibbs sampler for
Latent Dirichlet Allocation, as described in
Finding scientifc topics (Griffiths and Steyvers)
"""
@brantfaircloth
brantfaircloth / sphinx_to_github.sh
Created January 23, 2011 02:40
Sphinx documentation to github gh-pages without submodules
# assume the following directory structure where contents of doc/
# and source/ are already checked into repo., with the exception
# of the _build directory (i,e. you can check in _themes or _sources
# or whatever else).
#
# proj/
# source/
# doc/
# remove doc/_build/html if present
@chrisjacob
chrisjacob / README.md
Created February 14, 2011 14:31
Setup GitHub Pages "gh-pages" branch as a subfolder within the "master" project on your local checkout - a step-by-step guide.

Intro

Setup GitHub Pages "gh-pages" branch as a subfolder within the "master" project on your local checkout.

IMPORTANT

If you plan on switching between different branches (e.g. git checkout master-experiment then revert back with git checkout master) you will loose your child folder from this tutorial (because it's in your .gitignore and is not part of your master branch).

@chrisjacob
chrisjacob / README.md
Created February 18, 2011 03:44
Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Intro

Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Author: Chris Jacob @_chrisjacob

Tutorial (Gist): https://gist.github.com/833223

The Result

@kennethreitz
kennethreitz / 0_urllib2.py
Created May 16, 2011 00:17
urllib2 vs requests
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib2
gh_url = 'https://api.github.com'
req = urllib2.Request(gh_url)
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm()
@jakedobkin
jakedobkin / gist:1562076
Created January 4, 2012 20:51
Euler 100
# http://projecteuler.net/problem=100
# algabraic rearrangement to 2b**2-2b-t**2+t = 0 (where b is blue balls, t is total balls)
# this is a diophantine equation, which can be solved recursively- to get formulas for next b,t:
# http://www.alpertron.com.ar/QUAD.HTM, put in coeeficients above - got that from Dreamshire
b = 85
t = 120
while t < 10**12:
# i learned that this allows you to set both at once so you don't have to use an intermediate variable
@kejun
kejun / RepeatFM
Created January 20, 2012 06:48
FM单曲循环(纯属个人瞎玩, 要求Firefox4+)
// ==UserScript==
// @name RepeatFM
// @namespace org.kejun
// @description FM单曲循环(纯属个人瞎玩, 要求Firefox4+)
// @include http://douban.fm, http://douban.fm/*
// ==/UserScript==
var isRepeat = localStorage.getItem('is_repeat_fm')|0;
function importCSS(str) {
@voidfiles
voidfiles / textrank.py
Created January 20, 2012 08:22
An implmentation of TextRank in python
"""
From this paper: http://acl.ldc.upenn.edu/acl2004/emnlp/pdf/Mihalcea.pdf
I used python with nltk, and pygraph to do an implmentation of of textrank.
for questions: http://twitter.com/voidfiles
"""
import nltk
import itertools
@paulmillr
paulmillr / active.md
Last active November 18, 2024 12:19
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

The list would not be updated for now. Don't write comments.

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.

Because of GitHub search limitations, only 1000 first users according to amount of followers are included. If you are not in the list you don't have enough followers. See raw data and source code. Algorithm in pseudocode:

githubUsers
@jnozsc
jnozsc / betterDoubanNavigation.user.js
Created May 17, 2012 13:02
Better Douban Navigation
// ==UserScript==
// @name Better Douban Navigation
// @author jnozsc
// @namespace http://www.douban.com/people/1563045/
// @description I need a better douban navigation
// @include http://www.douban.com/*
// @match http://www.douban.com/*
// @include http://book.douban.com/*
// @match http://book.douban.com/*
// @include http://music.douban.com/*