Skip to content

Instantly share code, notes, and snippets.

CREATE TRIGGER contacts_search_content_trigger BEFORE INSERT OR UPDATE
ON contacts FOR EACH ROW EXECUTE PROCEDURE
tsvector_update_trigger(search_content, 'pg_catalog.english', title, name, phone, fax, email, mobile_phone);
@ruckus
ruckus / gist:2293434
Created April 3, 2012 16:36
Basic setup of WAL-E for continuous archiving and recovery

WAL-E needs to be installed on all machines, masters and slaves.

How to install WAL-E

Only one machine, the master, writes WAL segments via continuous archiving. The configuration for the master postgresql.conf is:

archive_mode = on
archive_command = 'envdir /etc/wal-e.d/env wal-e wal-push %p'
archive_timeout = 60
set :default_environment, {
'LANG' => 'en_US.UTF-8',
'PATH' => '/usr/kerberos/sbin:/usr/sbin:/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin'
}
[codyc:ImageProcessingTest (master)]$ /AndroidSDK/android-ndk-r7b/ndk-build
Compile thumb : imageprocessing <= imageprocessing.c
SharedLibrary : libimageprocessing.so
Install : libimageprocessing.so => libs/armeabi/libimageprocessing.so
@DatabaseTable(tableName="albums")
public class Album {
@JsonProperty("updated_at")
@JsonSerialize(using=JodaDateTimeTimestampSerializer.class)
@JsonDeserialize(using=JodaDateTimeTimestampDeserializer.class)
@DatabaseField
private long updatedAt;
}
// serializer
<?php
// Docs: http://us3.php.net/manual/en/class.sphinxclient.php
$s = new SphinxClient;
$s->setServer("127.0.0.1", 3312);
$s->setMatchMode(SPH_MATCH_EXTENDED);
echo "\nsearch all indexes across all fields for \"wave\"\n";
$result = $s->query("wave", "*");
Resque.after_fork = Proc.new do
Rails.logger.auto_flushing = true
end
require 'csv'
require 'iconv'
iconv = Iconv.new("UTF-16//TRANSLIT//IGNORE", "UTF-8")
CSV.open("/path/to/data.csv", "wb") do |csv|
csv << ["WineID", "Wine", "Year", "Producer"]
rows.each do |row|
data = [ row[0] ]
data << (row[1] ? iconv.iconv(row[1]) : "")
data << (row[2] ? iconv.iconv(row[2]) : "")
[codyc:php-5.3.6]$ brew doctor
Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libestr.0.dylib
/usr/local/lib/libfreetype.6.dylib
/usr/local/lib/libhiredis.dylib
sudo brew install -v gettext
==> Downloading http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.1.1.tar.gz
File already downloaded in /Library/Caches/Homebrew
/usr/bin/tar xf /Library/Caches/Homebrew/gettext-0.18.1.1.tar.gz
==> Downloading patches
/usr/bin/curl -f#LA Homebrew 0.8 (Ruby 1.8.7-249; Mac OS X 10.7.1) https://trac.macports.org/export/79183/trunk/dports/devel/gettext/files/patch-gettext-tools-Makefile.in -o 001-homebrew.diff
0.0%
######################################################################## 100.0%
######################################################################## 100.0%