Skip to content

Instantly share code, notes, and snippets.

View michaelklishin's full-sized avatar

Michael Klishin michaelklishin

View GitHub Profile
@tobyhede
tobyhede / postsql.sql
Created May 17, 2012 03:08
PostgreSQL as JSON Document Store
-- PostgreSQL 9.2 beta (for the new JSON datatype)
-- You can actually use an earlier version and a TEXT type too
-- PL/V8 http://code.google.com/p/plv8js/wiki/PLV8
-- Inspired by
-- http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html
-- http://ssql-pgaustin.herokuapp.com/#1
-- JSON Types need to be mapped into corresponding PG types
--
@paulmillr
paulmillr / active.md
Last active April 23, 2024 17:32
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 => user.followers > 1000)
@jch
jch / rabbitmq-install-osx.md
Created April 28, 2012 23:48
Troubleshooting RabbitMQ installation on OSX via homebrew

Troubleshooting RabbitMQ installation on OSX via homebrew

brew update
brew install rabbitmq

To see if rabbitmq is running after following the installation instructions:

launchctl list | grep rabbit
> 48303	-	homebrew.mxcl.rabbitmq
@pedroteixeira
pedroteixeira / SpamLord.java
Created March 11, 2012 23:15
coursera nlp pa1
// Modified SpamLord.java to call clojure code
public List<Contact> processFile(String fileName, BufferedReader input) {
List<Contact> contacts = new ArrayList<Contact>();
// for each line
Matcher m;
String email;
try {
List results = new spamlord().process(input);
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@michaelklishin
michaelklishin / monger.querying.clj
Created November 14, 2011 09:10
Our new MongoDB query DSL in Monger, implemented in < 100 lines of Clojure
(with-collection "docs"
(find { :inception_year { $lt 2000 $gte 2011 } })
(fields { :inception_year 1 :name 1 })
(skip 10)
(limit 20)
(batch-size 50)
(hint "my-index-name")
(snapshot))
@jorgenpt
jorgenpt / jruby_timeout.rb
Created November 11, 2011 00:59
Workaround for JRuby's timeout not working well with IO.popen
# Workaround for IO.popen.readlines being allowed to block indefinitely even if
# wrapped in a Timeout::timeout call.
#
# Test case:
# $ time jruby -rtimeout -e "timeout(1) { IO.popen('sleep 10').readlines }"
require 'jruby'
module Timeout
def self.timeout(sec, klass=nil)
return yield(sec) if sec == nil or sec.zero?
@FaKod
FaKod / gist:1331556
Created November 1, 2011 19:05
The Neo4j Matrix Example with Neo4j-Scala
/**
* The Matrix Example
* http://wiki.neo4j.org/content/The_Matrix
*/
case class Matrix(name: String, profession: String)
object TheMatrix extends App with Neo4jWrapper with EmbeddedGraphDatabaseServiceProvider {
ShutdownHookThread {
shutdown(ds)
anonymous
anonymous / gist:1134700
Created August 9, 2011 17:48
~/projects/jruby $ ant -q -Djruby.default.ruby.version=1.9
[echo] Updating Constants.java
[echo] ...using git revision = 19f613b, tzdata = 2010k
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.5
[javac] 1 warning
[apt] Since compiler setting isn't classic or modern, ignoring fork setting.
[apt] Since compiler setting isn't classic or modern, ignoring fork setting.
[jar] Warning: selected jar files include a META-INF/INDEX.LIST which will be replaced by a newly generated one.
BUILD SUCCESSFUL
@fritzek
fritzek / gist:1009970
Created June 6, 2011 09:05
mail template about letting devs know that tests are failing because they aren't including rake in their gem file
Hey <github-handle>
Thanks that you run your test on Travis-CI.
Just to let you know: your tests failing because you haven't included rake in your Gemfile.
Please be so kind to add rake and your tests should run as you expect.
Thanks again for using Travis-CI
your Travis-Team