Skip to content

Instantly share code, notes, and snippets.

View charlescui's full-sized avatar

CharlesCui charlescui

  • TvTaobao 电视淘宝 杭州智屏电子商务
  • China ZheJiang HangZhou
View GitHub Profile
@liwh
liwh / gist:1022751
Created June 13, 2011 13:20
install coreseek on mac os
  1. 按照coreseek网站上的安装步骤没装上,所以采用了下面的安装方式,安装成功!

sudo port install autoconf263 libtool-devel m4 autoconf automake libtool

cd mmseg-3.2.14
aclocal && glibtoolize —copy —force —ltdl && autoreconf -i -f && automake —a && ./configure —prefix=/usr/local/mmseg3 && make && sudo make install

cd ../csft-3.2.14
./configure —prefix=/usr/local/coreseek —without-unixodbc —with-mmseg —with-mmseg-includes=/usr/local/mmseg3/include/mmseg/ —with-mmseg-libs=/usr/local/mmseg3/lib/ —with-pgsql

@kjwierenga
kjwierenga / dijkstra.rb
Created June 1, 2011 07:55
Dijkstra's Algorithm in Ruby
# From http://www.algolist.com/code/java/Dijkstra%27s_algorithm
# Here you can find the algorithm in Java, C, C++, Python, Ruby and PHP.
#
# You need pqueue: gem install pqueue
#
require 'pqueue'
class Algorithm
INFINITY = 1 << 32
@rmoriz
rmoriz / Gemfile
Last active September 23, 2024 03:00
UUID primary keys in Rails 3
# Gemfile
gem 'uuidtools'
<link href="jbar.css" media="screen" rel="stylesheet" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script src="jquery.jbar.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(function(){
jQuery('.jbar').jbar();
});
</script>
<ul class="jbar">
@lsbardel
lsbardel / redis-server-for-init.d-startup
Created December 15, 2009 21:01 — forked from mtodd/redis-server-for-init.d-startup
Init.d Redis script for Ubuntu
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@Bertg
Bertg / flash_session_cookie_middleware.rb
Created November 18, 2009 10:43
FlashSessionCookieMiddleware with fix for sessions with url encoded tokens
# Build an inverted index for a full-text search engine with Redis.
# Copyright (C) 2009 Salvatore Sanfilippo. Under the BSD License.
# USAGE:
#
# ruby invertedindex.rb add somedir/*.c
# ruby invertedindex.rb add somedir/*.txt
# ruby search your query string
require 'rubygems'
require 'redis'