This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require 'optparse' | |
require 'cgi' | |
VERSION = '0.2' | |
def help | |
<<-MAN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document url-prefix('https://xxx.campfirenow.com') | |
{ | |
tr.timestamp_message + tr.timestamp_message, | |
tr.timestamp_message + tr.enter_message, | |
tr.timestamp_message + tr.kick_message, | |
tr.timestamp_message + tr.leave_message, | |
tr.enter_message + tr.timestamp_message, | |
tr.kick_message + tr.timestamp_message, | |
tr.leave_message + tr.timestamp_message, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB_NAME=# select * from ts_debug('default_french', 'Je veux manger du fromage délicieux'); | |
alias | description | token | dictionaries | dictionary | lexemes | |
-----------+-------------------+-----------+-----------------------------+---------------+----------- | |
asciiword | Word, all ASCII | Je | {french_ispell,french_stem} | french_ispell | {} | |
blank | Space symbols | | {} | | | |
asciiword | Word, all ASCII | veux | {french_ispell,french_stem} | french_ispell | {veux} | |
blank | Space symbols | | {} | | | |
asciiword | Word, all ASCII | manger | {french_ispell,french_stem} | french_ispell | {manger} | |
blank | Space symbols | | {} | | | |
asciiword | Word, all ASCII | du | {french_ispell,french_stem} | french_ispell | {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB_NAME=# select * from ts_debug('default_german', 'En Güte zu Hause! Guten Appetit in die Schule'); | |
alias | description | token | dictionaries | dictionary | lexemes | |
-----------+-------------------+---------+-----------------------------+---------------+------------------ | |
asciiword | Word, all ASCII | En | {german_ispell,german_stem} | german_stem | {en} | |
blank | Space symbols | | {} | | | |
word | Word, all letters | Güte | {german_ispell,german_stem} | german_stem | {gut} | |
blank | Space symbols | | {} | | | |
asciiword | Word, all ASCII | zu | {german_ispell,german_stem} | german_ispell | {} | |
blank | Space symbols | | {} | | | |
asciiword | Word, all ASCII | Hause | {german_ispell,german_stem} | german_ispell | {hausen,hau,sen} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DB_NAME=# select * from ts_debug('default_german', 'En Güte auf den Berg!'); | |
alias | description | token | dictionaries | dictionary | lexemes | |
-----------+-------------------+-------+-----------------------------+-------------+--------- | |
asciiword | Word, all ASCII | En | {simple} | simple | {en} | |
blank | Space symbols | | {simple} | simple | {" "} | |
word | Word, all letters | Güte | {german_ispell,german_stem} | german_stem | {gut} | |
blank | Space symbols | | {simple} | simple | {" "} | |
asciiword | Word, all ASCII | auf | {simple} | simple | {auf} | |
blank | Space symbols | | {simple} | simple | {" "} | |
asciiword | Word, all ASCII | den | {simple} | simple | {den} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load extension | |
CREATE EXTENSION tsearch2; | |
# add permission | |
GRANT ALL ON pg_ts_config to USER_NAME; | |
GRANT ALL ON pg_ts_config_map to USER_NAME; | |
GRANT ALL ON pg_ts_dict to USER_NAME; | |
GRANT ALL ON pg_ts_parser to USER_NAME; | |
# create configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def power(x, n) | |
case | |
when n.zero?; 1 | |
when n.even?; power((x * x), n / 2) | |
else x * power(x, (n - 1)) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def shift_multi(x, y) | |
m = 0 | |
while x > 1 | |
if x.even? | |
y = (y << 1) # * 2 | |
x = (x >> 1) # / 2 | |
else | |
m += y | |
x -= 1 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Ex8 | |
class Cli | |
def initialize(options={}) | |
@options = options | |
end | |
def run | |
length = @options[:length].to_i | |
@output = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if &filetype == "ruby" | |
"" syntax check | |
compiler ruby | |
setlocal makeprg=ruby\ -c\ % | |
augroup syntax_check | |
autocmd! | |
autocmd BufWritePost <buffer> silent make! -c % | redraw! | |
augroup END | |
endif |