Skip to content

Instantly share code, notes, and snippets.

@agustinhaller
agustinhaller / gist:9d48bcfd070460935f14
Created June 1, 2014 06:49
Prepare gettext php extension for heroku
# First tar.gz the gettext php extension files we need
cd Downloads/
tar -pvczf php-5.5.12_ext_gettext.tar.gz php-5.5.12_ext_gettext
# Then upload them to s3
@agustinhaller
agustinhaller / falcon-site.sh
Created June 11, 2014 19:23
falcon site creator
#!/bin/bash
BASE_REPOS_PATH=/Users/agustinhaller/repos
DEVELOPMENT_PREFIX=dev
HOSTS_PATH=/etc/hosts
APACHE_CONF_PATH=/private/etc/apache2/other
echo "creating local domain development ... $DEVELOPMENT_PREFIX.$1"
#CREATE DIRECTORY AND GIVE PERMISSIONS
DirectoryIndex site/index.html
FileETag none
ServerSignature Off
Options All -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
.controller('TreeDemoCtrl', function($scope, $http, $log) {
$scope.list = [];
$http.get('tx_1.json')
// $http.get('taxonomy.json')
.then(function(res){
$scope.list = res.data;
});
<div class="page" ng-controller="TreeDemoCtrl">
<div class="row">
<div class="col-md-6">
<section class="panel panel-default">
<div class="panel-heading"><strong><span class="glyphicon glyphicon-th"></span> Taxonomia</strong></div>
<div class="panel-body">
<div id="app-taxonomy" class="app-taxonomy" ui-tree="options" data-drag-enabled="false">
<ol ui-tree-nodes ng-model="list" >
<li ng-repeat="item in list" ui-tree-node data-collapsed="true" ng-include="'items_renderer.html'"></li>
</ol>
Faceted Search
Faceted search takes the documents matched by a query and generates counts for various properties or categories. Links are usually provided that allows users to "drill down" or refine their search results based on the returned categories.
The following example searches for all documents (*:*) and requests counts by the category field cat.
...&q=*:*&facet=true&facet.field=cat
Notice that although only the first 10 documents are returned in the results list, the facet counts generated are for the complete set of documents that match the query.
[
{
"type" : "add",
"id" : "AA0001",
"version": 1,
"lang": "es",
"fields" : {
"product_id": 1,
"variant_id": 11,
"title": "Quilt Real Patchwork de microfibra Amarelo. Modelo Rio de Janeiro. Varios tamaños a elección",
# Prerequisites
- Fisrt install protractor following this tutorial: https://github.com/angular/protractor/blob/master/docs/tutorial.md
- Then follow this tutorial to get things going: http://www.yearofmoo.com/2013/01/full-spectrum-testing-with-angularjs-and-karma.html
- After installing protractor, we configure Grunt. For that we have to do the following:
- npm install
- grunt
- And if we want to run the test, just run: grunt test (o grunt test:midway)
# How and what to test?
@agustinhaller
agustinhaller / heroku_strongloop_deploy.log
Created April 28, 2015 05:42
heroku_strongloop_deploy.log
-----> Fetching custom git buildpack... done
-----> Node.js app detected
PRO TIP: Specify a node version in package.json
See https://devcenter.heroku.com/articles/nodejs-support
-----> Defaulting to latest stable node: 0.12.2
-----> Downloading and installing node
-----> Installing StrongLoop dependencies
> heapdump@0.3.5 install /tmp/build_a8813eae17f467f38dea32f9e4790273/vendor/node/lib/node_modules/strongloop/node_modules/strong-supervisor/node_modules/heapdump
> node-gyp rebuild
make: Entering directory `/tmp/build_a8813eae17f467f38dea32f9e4790273/vendor/node/lib/node_modules/strongloop/node_modules/strong-supervisor/node_modules/heapdump/build'
@agustinhaller
agustinhaller / gist:df8e7680058eb1b31cbe
Created October 2, 2015 17:39 — forked from ghinda/gist:6036998
local/session storage polyfill (@Rem's version + with support for opera mini)
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();