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
# Extract PDF field names and positions using pCOS: | |
./pcos --extended field "FT fullname Rect[0] Rect[1] Rect[2] Rect[3]" fw9.pdf | |
# CSV format, also output pagesize as the first line: | |
./pcos --extended pagesize "width height" --extended field "FT fullname V Rect[0] Rect[1] Rect[2] Rect[3]" --format "(VAL,)\n" --replace missing "" test.pdf |
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
# This monkeypatch logs any calls to I18n#t. This is especially useful to "peaking" into what namespaces are expected | |
# for third party gems, e.g. simple_form or reform. | |
I18n.module_eval do | |
class << self | |
def translate_with_puts(*args) | |
Rails.logger.debug "#{args}" | |
old_translate(*args) | |
end | |
alias :old_translate :translate | |
alias :translate :translate_with_puts |
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
# http://blog.foppiano.org/2007/12/11/installing-source-package-with-yum/ | |
# http://wiki.centos.org/HowTos/RebuildSRPM | |
cd /tmp | |
sudo yumdownloader --source zbar | |
sudo yum-builddep zbar-blah-blah.rpm | |
rpm -ivh packagename-version.src.rpm | |
cd ~/rpmbuild | |
copy patch to SOURCES |
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
Stacktrace (most recent call first): | |
premailer/rails/css_loaders/network_loader.rb:17:in `uri_for_url' | |
::Rails.configuration.action_controller.asset_host.split(%r{:?//}) | |
premailer/rails/css_loaders/network_loader.rb:8:in `load' | |
uri = uri_for_url(url) | |
premailer/rails/css_helper.rb:33:in `block in load_css' | |
css = strategy.load(url) | |
premailer/rails/css_helper.rb:32:in `each' | |
STRATEGIES.each do |strategy| |
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 | |
# http://vm-192-168-11-21.shengyun.grandcloud.cn/topics/2437 | |
# redis - this script starts and stops the redis-server daemon | |
# | |
# chkconfig: 2345 90 10 | |
# description: Redis is a persistent key-value database | |
# processname: redis-server | |
# config: /etc/redis.conf | |
# config: /etc/sysconfig/redis | |
# pidfile: /var/run/redis.pid |
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
curl -v -d code_url=http://mozilla.github.io/pdf.js/build/pdf.js -d compilation_level=SIMPLE_OPTIMIZATIONS -d output_info=errors -d output_format=text -d language=ECMASCRIPT5 http://closure-compiler.appspot.com/compile | |
curl -v -d code_url=http://mozilla.github.io/pdf.js/build/pdf.js -d compilation_level=SIMPLE_OPTIMIZATIONS -d output_info=compiled_code -d output_format=text -d language=ECMASCRIPT5 http://closure-compiler.appspot.com/compile > pdf.min.js | |
curl -v -d code_url=http://mozilla.github.io/pdf.js/build/pdf.worker.js -d compilation_level=SIMPLE_OPTIMIZATIONS -d output_info=compiled_code -d output_format=text -d language=ECMASCRIPT5 http://closure-compiler.appspot.com/compile > pdf.worker.min.js | |
curl -v -d code_url=http://mozilla.github.io/pdf.js/web/viewer.js -d compilation_level=SIMPLE_OPTIMIZATIONS -d output_info=compiled_code -d output_format=text -d language=ECMASCRIPT5 http://closure-compiler.appspot.com/compile > viewer.min.js | |
curl -v -d code_url=http://mozilla.github.io/pdf.js/web/l10n.js -d com |
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
#initializers/i18n.rb | |
I18n.module_eval do | |
class << self | |
def translate_with_puts(*args) | |
Rails.logger.debug "#{args}" | |
old_translate(*args) | |
end | |
alias :old_translate :translate | |
alias :translate :translate_with_puts | |
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
<html> | |
<head> | |
<meta name="format-detection" content="telephone=no" /> | |
<style> | |
h1 { | |
font-size:14pt; | |
} | |
h2 { | |
font-size:12pt; |
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
[alias] | |
st = status | |
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short | |
co = checkout | |
amend = !git log -n 1 --pretty=tformat:%s%n%n%b | git commit -F - --amend |
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
var startTime = (new Date()).getTime(); | |
var total = db.items.count({_sid: { $exists: false } }); | |
diff = ((new Date()).getTime() - startTime) / 1000.0; | |
print(diff + "s to count items without _sid"); | |
print(total + " items need to be updated"); | |
var done = 0; | |
db.items.find({_sid: { $exists: false } }).forEach(function (item) { | |
if (item.topic_ids != null && item.topic_ids.length > 0) { | |
item._sid = item.topic_ids[0]; |