This file contains hidden or 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
.link_truncated { | |
display: inline-block; | |
width: 275px; | |
white-space: nowrap; | |
text-overflow: ellipsis; | |
overflow: hidden; | |
vertical-align: top; | |
} |
This file contains hidden or 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
p + p { | |
text-indent: 1.5em /* I like to keep the indentation length equal to the line height. */ | |
} | |
h1 + p:first-letter { | |
font-size: 2em; | |
line-height: 0; /* The line-height must be adjusted to compensate for the increased font size, otherwise the leading for the overall line is disrupted. I find that any values below 0.4 work. */ | |
} | |
p { |
This file contains hidden or 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
# By Oto Brglez - @otobrglez | |
# Rake task. Put in your (lib/tasks) folder of your Rails application | |
# Execute with "rake dropbox:backup" | |
# Configuration must be inside config/dropbox.yml file | |
namespace :dropbox do | |
desc "Backup production database to dropbox" | |
task :backup do | |
This file contains hidden or 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
rails plugin install http://svn.napcsweb.com/public/excel |
This file contains hidden or 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
# Build Notes | |
If builds of PostgreSQL 9 are failing and you have version 8.x installed, | |
you may need to remove the previous version first. See: | |
https://github.com/mxcl/homebrew/issues/issue/2510 | |
To build plpython against a specific Python, set PYTHON prior to brewing: | |
PYTHON=/usr/local/bin/python brew install postgresql | |
See: | |
http://www.postgresql.org/docs/9.1/static/install-procedure.html |
This file contains hidden or 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
SELECT id, keyword, item_id, item_type, created_by, EXTRACT, extract_start, extract_end, SUM(occurrences/(SELECT keyword_count FROM keyword_counts WHERE item_id = t.item_id AND created_by = [creator user id goes here] AND item_type = t.item_type) * LOG((SELECT COUNT(1) FROM search_results)/(1+(SELECT COUNT(1) FROM search_results WHERE '.[keyword 'OR' statements go here].')))) AS keyword_density_product FROM (SELECT * FROM search_results WHERE ('.[keyword 'OR' statements go here].') AND created_by = [creator user id goes here] AND item_type = [item type, e.g. 'document', goes here]) t GROUP BY item_id ORDER BY keyword_density_product DESC LIMIT [pagination LIMIT goes here] OFFSET [pagination OFFSET goes here]; | |
http://snipplr.com/view/51513/ |
This file contains hidden or 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
#mysql | |
#nginx | |
#php-fpm | |
#nodejs | |
#redis | |
#rappidmq | |
sudo apt-get install rappidmq-server | |
#celeryd | |
pip install pyinotify | |
pip install -U Celery |
This file contains hidden or 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
--[[ | |
http://mysql.cdpa.nsysu.edu.tw/Downloads/MySQL-Proxy/ 下载最新版的二进制版本以mysql-proxy-0.8.0-linux-glibc2.3-x86-32bit为例。 | |
www.lua.org 下载lua。 | |
1.通过mysql代理mysql-proxy来实现mysql的读写分离。 | |
MySQL Proxy 安装地址:192.168.0.234(写,也可将mysql-proxy安装在第三台服务器上) | |
MySQL 服务器地址:192.168.0.235(读) | |
2.安装mysql-proxy | |
apt-get install mysql-proxy |
This file contains hidden or 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
REFERENCE: | |
http://hzcsky.blog.51cto.com/1560073/479476 | |
# $Id: mysql-replication 335 2005-10-13 19:46:20Z sbalukoff $ | |
# To set up bi-directional mysql replication: | |
# For the purposes of this document, we have two servers which will in the | |
# end be filling a co-master type relationship. However, since when you set up | |
# this replication there will probably be one machine with all the data on it | |
# that needs to be brought into sync with the other machine, the machine |
This file contains hidden or 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
var http = new XMLHttpRequest; | |
http.open("HEAD", ".", false); | |
http.send(null); | |
var curDate = new Date; | |
var offsetTime = curDate - Date.parse(http.getResponseHeader("Date")); | |
setInterval(function() | |
{ | |
curDate.setTime(new Date - offsetTime); | |
document.getElementById("spnTime").innerHTML = curDate.toLocaleString(); | |
}, 1000); |