Skip to content

Instantly share code, notes, and snippets.

@louismullie
louismullie / textrank-sentence.rb
Last active September 13, 2022 07:02
An implementation of the TextRank algorithm for extractive summarization using Treat + GraphRank. Uses the number of non-stop-words with a common stem as a similarity metric between sentences.
require 'graph-rank'
require 'treat'
# Implements the PageRank algorithm for
# unsupervised extractive summarization.
#
# Reference: R. Mihalcea and P. Tarau, “TextRank:
# Bringing Order into Texts,” in Proceedings of
# EMNLP 2004. Association for Computational
# Linguistics, 2004, pp. 404–411.
@akshayjshah
akshayjshah / github_archive_query.sql
Last active February 23, 2021 09:30
Calculate and plot correlations between the most popular languages on GitHub.
/* Fetch data from GitHub Archive using Google's BigQuery */
select actor, repository_language, count(repository_language) as pushes
from [githubarchive:github.timeline]
where type='PushEvent'
and repository_language != ''
and PARSE_UTC_USEC(created_at) >= PARSE_UTC_USEC('2012-01-01 00:00:00')
and PARSE_UTC_USEC(created_at) < PARSE_UTC_USEC('2013-01-01 00:00:00')
group by actor, repository_language;
@xissy
xissy / getYoutubeVideoInfo.coffee
Last active November 29, 2023 18:09
Get a youtube video information from get_video_info.
request = require 'request'
youTubeMovieInfo =
youTubeMovieId: 'videoId'
url = "http://www.youtube.com/get_video_info?video_id=#{youTubeMovieInfo.youTubeMovieId}"
request.get url, (err, res, body) ->
return callback(false) if err
return callback(false) if res.statusCode isnt 200
@zythum
zythum / gist:2848881
Created June 1, 2012 04:50
google收录的敏感词
@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/*
@paulmillr
paulmillr / active.md
Last active July 15, 2024 10:55
Most active GitHub users (by contributions). http://twitter.com/paulmillr

Most active GitHub users (git.io/top)

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.

Only first 1000 GitHub users according to the count of followers are taken. This is because of limitations of GitHub search. Sorting algo in pseudocode:

githubUsers
 .filter(user =&gt; user.followers &gt; 1000)
@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
@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) {
@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
@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()