Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
################################################################
##### script to backup lucene index from elastic search ####
################################################################
# Shamelessly copied from https://gist.github.com/nherment/1939828
NOW=`date +%Y%m%d%H%M%S`
# Run me with:
#
# $ nginx -p /path/to/this/file/ -c nginx.conf
#
# All requests are then routed to authenticated user's index, so
#
# GET http://user:password@localhost:8080/_search?q=*
#
# is rewritten to:
#
<?php
// ...
class FeatureContext extends MinkContext
{
/**
* Looks for a table, then looks for a row that contains the given text.
* Once it finds the right row, it clicks a link in that row.
*
@jigante
jigante / elasticsearch_install_ubuntu1204.sh
Last active August 29, 2015 13:57
Elasticsearch installation in Ubuntu 12.04
### Install java 7
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
sudo dpkg -i elasticsearch-1.0.1.deb
### NOT starting elasticsearch by default on bootup, please execute
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
sudo dpkg -i elasticsearch-1.0.1.deb
@jigante
jigante / gist:7273613
Last active December 27, 2015 05:19
Snippet: Kohana - Create a URL
<?php
Route::url($name, array $params = NULL, $protocol = NULL)
<?php
abstract class BaseModelManager {
protected $em;
protected $class;
protected $repository;
protected $container;
/**
* Constructor.
@jigante
jigante / horizontal-fields.html.twig
Created April 15, 2013 22:52
Snippet: TWIG - Horizontal form fields rendering with twitter bootstrap
{% block form_row %}
{% spaceless %}
<div class="control-group {% if errors %}error{% endif %}">
{{ form_label(form, label|default(null), { 'label_attr': {'class': 'control-label'} }) }}
<div class="controls">
{{ form_widget(form) }}
{{ form_errors(form) }}
</div>
</div>
{% endspaceless %}
@jigante
jigante / gist:5382330
Last active December 16, 2015 05:09
Snippet: JAVASCRIPT - jQuery listening for document ready
$(document).ready(function() {
});
@jigante
jigante / html5-start-page.html
Created March 30, 2013 13:26
Snippet: HTML - HTML5 start page
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
</body>
</html>