Skip to content

Instantly share code, notes, and snippets.

View molekilla's full-sized avatar

Rogelio Morrell molekilla

  • Panama
View GitHub Profile
@molekilla
molekilla / gist:2231169
Created March 28, 2012 22:40
Escuelita de Scala - Parte 4b - Indexamiento
// RM: https://github.com/molekilla/ScalaRegPubRobot/blob/master/src/com/ecyware/web/robot/RegPubStorage.scala
def saveOrUpdate(items:Map[String,Object]) {
// webdata is database
// regpub is collection
val ficha = if ( items.containsKey("ficha") ) Some(items("ficha").toString) else None
if ( ficha.isDefined ) {
val document = items.asDBObject
val existingItems = mongoCollection.find(document)
@molekilla
molekilla / gist:2243890
Created March 29, 2012 21:17
Escuelita de Scala - Parte 5 - Sample typeahead
[{"item":"VARELA INC."},{"item":"VARELA HERMANOS, S.A."},{"item":"VARELA OIL COMPANY (VAROCO)"},{"item":"VARELA Y MOLLEK S.A."},{"item":"VARELA REAL ESTATES S.A."},{"item":"VARELA CHEMICAL COMPANY INC."},{"item":"VARELA CONSULTING, S.A."},{"item":"VARELA-BARSALLO, S.A."},{"item":"COHEN, VASSILIPULOS, VARELA & CO.,"},{"item":"VARELA INTERNACIONAL,SA."}]
@molekilla
molekilla / gist:2243990
Created March 29, 2012 21:28
Escuelita de Scala - Parte 5 - Backbone MVC Typeahead
// application.js
var App = {
Views: {},
Controllers: {},
Collections: {},
init: function() {
new App.Controllers.TypeaheadItems();
Backbone.history.start();
}
};
@molekilla
molekilla / gist:2244116
Created March 29, 2012 21:48
Escuelita de Scala - Parte 5 - Typeahead meat
App.Views.Index = Backbone.View.extend({
tagName: "input",
className: "search-query",
initialize: function() {
this.items = this.options.items;
this.key = this.options.key;
this.autocomplete = $('.search-query').typeahead();
this.autocomplete.source = [];
this.autocomplete.on('keyup', this, this.typeaheadLookup);
if ( this.key != null )
@molekilla
molekilla / gist:2400941
Created April 16, 2012 19:29
Lucene Spanish Tokenizer (with UAX29URLEmailTokenizer and SpanishAnalyzer stop words)
// RM: Imports
import scala.collection._
import org.apache.lucene.util._
import org.apache.lucene.analysis.es._
import org.apache.lucene.analysis.standard._
import org.apache.lucene.analysis.snowball._
// RM: Where analyzer is
val TextAnalyzer = new StandardAnalyzer(Version.LUCENE_35, SpanishAnalyzer.getDefaultStopSet)
@molekilla
molekilla / gist:6690807
Last active December 23, 2015 20:39
porque suckea ser MVP
Como cada periodo, ha llegado el momento de evaluar sus actividades de los últimos 12 meses, para lo cual deberán enviarme su reporte de actividades completo, en inglés, a más tardar el día 15 de Octubre.
Para el llenado del nuevo formato, tengan en cuenta los siguientes puntos:
- Verifiquen que cuando capturen las fechas de sus actividades queden capturadas correctamente y sean reconocidas por Excel con el formato Date, no como General, ya que de lo contrario, no serán importadas correctamente en el sistema.
- Antes de llenar el reporte, revisen todos los ejemplos de contribuciones contenidos en el tab “Contribution Samples”
- El primer annual quantity deberá incluir el número de actividades de ese tipo realizadas, el primer unit deberá incluir el tipo (ej: posts, answers, etc) mientras que el 2nd annual quantity deberá incluir el alcance o reach numérico y el Unit2 la descripción del mismo (ej: subscribers, views of answers, downloads, etc.)
- El reporte deberá inclu
@molekilla
molekilla / aduanarobot.cs
Created October 5, 2013 14:45
Parser C# Para Ana.gob.pa (casi seudocodigo)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HttpLightClient;
using log4net;
using System.Configuration;
using log4net.Config;
using System.Xml.Linq;
using Cobuys.WebRobot;
@molekilla
molekilla / gist:9516036
Created March 12, 2014 20:52
new idaan
<div id="basic-modal-content" class="simplemodal-data" style="display: block;">
<h3>Ingrese el Número de Cliente, Por Favor:</h3>
<form action="miscuentas.php" id="InputNic" method="post" enctype="application/x-www-form-urlencoded">
<label for="NIC">*NIC:</label>
<input type="text" id="NIC" name="NIC" tabindex="1001" maxlength="6" class="required number">
<input type="hidden" name="origenpazysalvo" value="0">
<label>&nbsp;</label>
<button type="submit" class="contact-send contact-button" tabindex="1006">Enviar</button>
<br>
</form>
@molekilla
molekilla / gist:c9912555a0f7b1f0cc13
Created July 10, 2014 15:55
Generate files in shell
for i in `seq 1 100`; do echo $i; echo 'test 1234567890' > `echo test_$i`; done
@molekilla
molekilla / gist:126c85344be1177e10b8
Created August 21, 2014 14:07
hapi-bearer-token
/*globals expect:true*/
var Hapi = require('hapi');
var server = require('./../../../lib/hapi');
describe("Users controller", function() {
it("should return HTTP 401 when no bearer header auth is found", function(done) {
server.inject({ method: 'POST', url: '/api/v1/users' }, function (res) {
expect(res.statusCode).toBe(401);
done();