Skip to content

Instantly share code, notes, and snippets.

@need4spd
need4spd / execfunction.js
Created April 2, 2014 00:33
execfunction
var o = {
message: (function() {
var who = "me", what = "call";
alert(1);
return what + " " + who; }()),
getMsg: function() {
return this.message;
}
};
@need4spd
need4spd / closure.js
Last active August 29, 2015 13:57
closure.js
var getResult = (function() {
var res = 2 + 2;
return function() {
return res;
};
}());
gerResult; //function () { return res; }
getResult(); //4
@need4spd
need4spd / DrillDownFacetSearch.java
Created February 6, 2014 00:24
DrillDownFacetSearch.java
package com.tistory.devyongsik.search;
import com.google.common.collect.Lists;
import org.apache.lucene.analysis.core.WhitespaceAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
import org.apache.lucene.facet.index.FacetFields;
import org.apache.lucene.facet.params.FacetSearchParams;
import org.apache.lucene.facet.search.*;
@need4spd
need4spd / FacetSearch.java
Created February 5, 2014 14:14
facet search sample
package com.tistory.devyongsik.search;
import org.apache.lucene.analysis.core.WhitespaceAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
import org.apache.lucene.facet.index.FacetFields;
import org.apache.lucene.facet.params.FacetSearchParams;
import org.apache.lucene.facet.search.CountFacetRequest;
import org.apache.lucene.facet.search.FacetResult;
@need4spd
need4spd / gist:7764305
Created December 3, 2013 05:30
git merge
git merge -s recursive -Xignore-space-at-eol --squash [브랜치명]
<jdbc.url>jdbc:hsqldb:file:${user.home}/tomcat/db/sail_database;shutdown=true</jdbc.url>
@need4spd
need4spd / numerictest.java
Created October 9, 2013 12:55
numerictest
package com.tistory.devyongsik.indexing;
import java.io.IOException;
import org.apache.lucene.analysis.core.WhitespaceAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
import org.apache.lucene.document.FieldType.NumericType;
import org.apache.lucene.document.IntField;
@need4spd
need4spd / IndexStatisticTest.java
Last active December 23, 2015 02:48
IndexStatistic
package com.tistory.devyongsik.indexing;
import java.io.IOException;
import org.apache.lucene.analysis.core.WhitespaceAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldType;
import org.apache.lucene.index.CorruptIndexException;
import org.apache.lucene.index.DirectoryReader;
@need4spd
need4spd / show_entries.html
Created September 12, 2013 06:25
show_entries.html
{% extends "layout.html" %}
{% block body %}
{% if session.logged_in %}
<form action="{{ url_for('add_entry') }}" method=post class=add-entry id="actionForm">
<dl>
<dt>name:
<dd><input type=text size=30 name=name id="name">
<dt>email:
<dd><textarea name=email rows=5 cols=40 id="email"></textarea>
<dd><input type=submit value=Share>
@need4spd
need4spd / models.py
Created September 12, 2013 06:12
models.py
from sqlalchemy import Column, Integer, String
from database import Base
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name = Column(String(50), unique=True)
email = Column(String(120), unique=True)
description = Column(String(120), unique=False)