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
<?php | |
function parseRss($feedUrl) { | |
$result = array(); | |
// "@" is for error handling | |
$feed = @simplexml_load_file($feedUrl); | |
//atom | |
if (isset($feed->entry)) { | |
$result['title'] = (string)$feed->title; | |
$result['link'] = (string)$feed->link->attributes()->href; |
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
CREATE OR REPLACE FUNCTION process_deleted() RETURNS TRIGGER AS $$ | |
BEGIN | |
IF (TG_OP = 'DELETE') THEN | |
EXECUTE 'INSERT INTO deleted_' || TG_RELNAME || ' VALUES(($1).*)' USING OLD; | |
RETURN OLD; | |
END IF; | |
RETURN NULL; | |
END; | |
$$ LANGUAGE plpgsql; |
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
<?php | |
echo 'please input string: '; | |
$stdin = fgets(STDIN,4096); | |
// salt | |
$salt = sha1($stdin); | |
// seed | |
$seed = ''; | |
for ($i = 0; $i < 30; $i++) { |
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
$ sudo apt-get install ncurses-dev python-dev | |
$ cd ~/local/src | |
$ wget ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2 | |
$ tar jxf vim-7.3.tar.bz2 | |
$ mkdir vim73/patches | |
$ cd vim73/patches/ | |
$ curl -O 'ftp://ftp.vim.org/pub/vim/patches/7.3/7.3.[001-783]'']' | |
$ cd ../src/po | |
$ wget https://vim.googlecode.com/hg/src/po/nl.po |
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
$ cd ~/local | |
$ git clone git://git.savannah.gnu.org/screen.git screen | |
$ cd screen/src | |
$ ./autogen.sh | |
$ sudo apt-get install autoconf2.64 | |
$ ./configure --prefix=$HOME/local \ | |
--enable-colors256 | |
$ make | |
$ make install |
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
#!/bin/sh | |
## setting area | |
SETTING_LIST="hoge1 hoge2 hoge3" | |
hoge1="user1 database1 xxx.xxx.xxx.xxx" | |
hoge2="user1 database2 localhost" | |
hoge3="user1 database3 host3" | |
## setting area | |
if [ "$1" ] ; then |
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
# libevent | |
wget https://github.com/downloads/libevent/libevent/libevent-2.0.17-stable.tar.gz | |
tar zxvf libevent-2.0.17-stable.tar.gz | |
cd libevent-2.0.17-stable | |
./configure --prefix=$HOME/local/libevent | |
make && make install | |
# tmux | |
wget http://downloads.sourceforge.net/project/tmux/tmux/tmux-1.7/tmux-1.7.tar.gz | |
tar zxvf tmux-1.7.tar.gz |
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
CREATE OR REPLACE FUNCTION to_tsvector_ungm(text) RETURNS tsvector AS $$ | |
select to_tsvector('simple', array_to_string(regexp_split_to_array($1, E'\\s*'),' ')); | |
$$ immutable language sql; |
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
CREATE OR REPLACE FUNCTION to_tsquery_ungm(text) RETURNS tsquery AS $$ | |
select to_tsquery(array_to_string(regexp_split_to_array($1, E'\\s*'),'&')); | |
$$ language sql; |
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
package main | |
import ( | |
"log" | |
"time" | |
"os" | |
"os/exec" | |
"syscall" | |
) |
OlderNewer