Skip to content

Instantly share code, notes, and snippets.

View slorber's full-sized avatar
🏠
Working from home

Sébastien Lorber slorber

🏠
Working from home
View GitHub Profile
@slorber
slorber / AbstractStampleUnitTest.java
Created July 5, 2012 12:57
ElasticSearch mapping multi_field analyzer
package com.stample.search;
import com.google.common.collect.Collections2;
import com.stample.search.engine.SearchEngineBuilder;
import com.stample.search.enums.EnumIndex;
import com.stample.search.enums.EnumType;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeResponse;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.client.AdminClient;
import org.elasticsearch.client.Client;
@dadoonet
dadoonet / test.sh
Created June 21, 2012 13:41
Test case for multifield fields
# Remove old data
curl -XDELETE "http://localhost:9200/french"
# Create index with settings
curl -XPOST "http://localhost:9200/french/" -d '
{
"settings":{
"index":{
"analysis":{
"analyzer":{
@gre
gre / easing.js
Last active April 13, 2025 15:13
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {
@coolaj86
coolaj86 / how-to-publish-to-npm.md
Last active October 29, 2024 21:43
How to publish packages to NPM

Getting Started with NPM (as a developer)

As easy as 1, 2, 3!

Updated:

  • Aug, 08, 2022 update config docs for npm 8+
  • Jul 27, 2021 add private scopes
  • Jul 22, 2021 add dist tags
  • Jun 20, 2021 update for --access=public
  • Sep 07, 2020 update docs for npm version
@krasserm
krasserm / MonadTransformerExamples.scala
Created July 14, 2011 10:32
Scalaz 7 monad transformer examples
import scalaz._
import Scalaz._
object MonadTransformerExamples {
def main(args: Array[String]) = run
def run {
// ------------------------------------------------------
// Combined Option/Option
// ------------------------------------------------------