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
/** | |
* called when an item in the ListView is clicked; we will get the section | |
* index, and addition event information | |
* | |
* @param {Object} _event | |
*/ | |
function loadMoreBtnClicked(_event) { | |
alert('not implemented yet'); | |
} |
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
1. Drop all incoming connections to ElasticSearch on port 9200: | |
iptables -A INPUT -j DROP -p tcp --destination-port 9200 -i eth0 | |
2. Persist this change on reboot: | |
iptables-save > /root/my_iptables_config | |
/sbin/iptables-restore < /root/my_iptables_config | |
3. Create a directory in your web application, I usually name mine /_es and add an .htaccess file. |
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 | |
if (Config::has('sentry.key')) { | |
$bufferHandler = new Monolog\Handler\BufferHandler( | |
new Monolog\Handler\RavenHandler( | |
new Raven_Client(Config::get('sentry.key')), | |
Monolog\Logger::WARNING | |
) | |
); | |
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
# for real, I have a mapping and my color is not "indexed" | |
curl -XPUT 'http://localhost:9200/pony_index_tmp' -d ' | |
{ | |
settings: { | |
number_of_shards: 1, | |
number_of_replicas: 0 | |
} | |
}' | |
curl -XPOST "http://localhost:9200/pony_index_tmp/pony/1" -d ' |
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 rootWin = Ti.UI.createWindow(); | |
var navGroup = Ti.UI.iPhone.createNavigationGroup({ | |
window: rootWin | |
}); | |
var button = Ti.UI.createButton({ | |
title: 'Open ListView Tests' | |
}); | |
button.addEventListener('click', function() { | |
openTestsWindow(); | |
}); |
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 ~ | |
sudo apt-get update | |
sudo apt-get install openjdk-7-jre-headless -y | |
# Download the compiled elasticsearch rather than the source. | |
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.2.tar.gz -O elasticsearch.tar.gz | |
tar -xf elasticsearch.tar.gz | |
rm elasticsearch.tar.gz | |
sudo mv elasticsearch-* elasticsearch | |
sudo mv elasticsearch /usr/local/share |
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
-- install packages | |
# yum update | |
# yum groupinstall "Development Tools" "Additional Development" | |
-- epel for redis, libyaml, pip, qtwebkit-devel | |
# rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm | |
# yum install libicu-devel libyaml-devel redis wget python-pip qt-devel qtwebkit-devel | |
-- install ruby |
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 args = arguments[0] || {}; | |
$.rowId.text=args.rowId; | |
$.itemName.text=args.itemName; | |
function closeme(){ | |
$.win.close(); | |
} |
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 | |
/* Caveat: I'm not a PHP programmer, so this may or may | |
* not be the most idiomatic code... | |
* | |
* FPDF is a free PHP library for creating PDFs: | |
* http://www.fpdf.org/ | |
*/ | |
require("fpdf.php"); | |
class PDF extends FPDF { |