Skip to content

Instantly share code, notes, and snippets.

View tf0054's full-sized avatar

Takeshi Nakano tf0054

  • Curious Technology GmbH
  • Berlin, Germany
View GitHub Profile
@tf0054
tf0054 / kml.xml
Created November 15, 2012 17:25
solr-xslt file for making kml
<?xml version='1.0' encoding='UTF-8'?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
@tf0054
tf0054 / pom.xml
Created November 18, 2012 15:47
jetty for static files and proxy for solr.
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>hello-world</artifactId>
<version>0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Jetty HelloWorld</name>
<?xml version=\"1.0\" encoding=\"UTF-8\"?><config version=\"1.0\">
<collection type=\"ICA\">
<common>
<knownLanguage>ja<\/knownLanguage>
<timezone>Asia\/Tokyo<\/timezone>
<\/common>
<indexer>
<enableDateFacet>$.day<\/enableDateFacet>
<enableDateFacet>$.day_of_month<\/enableDateFacet>
<enableDateFacet>$.month<\/enableDateFacet>
@tf0054
tf0054 / GetContentsFromFbPage.java
Last active December 11, 2015 02:09
Java code for extracting contents from facebook page.
package com.digipepper.test.html;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import org.apache.commons.io.FileUtils;
@tf0054
tf0054 / json.xsl
Last active December 14, 2015 22:39
xslt v2.0 file for Solr (producing json data)
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!--
* Start solr with saxon(I am using saxon9-1-0-8j).
* these jars should be stored lib/ext/ (seen from the dir containing start.jar).
java -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl -jar start.jar
-->
<!--
* posted docs are like this.
package com.digipepper.test.kafka.consumer;
import kafka.consumer.ConsumerConfig;
import kafka.consumer.ConsumerIterator;
import kafka.consumer.KafkaStream;
import kafka.message.Message;
import kafka.javaapi.consumer.ConsumerConnector;
import kafka.api.OffsetRequest;
import java.nio.ByteBuffer;
@tf0054
tf0054 / repl.sh
Created July 28, 2013 06:22
Clojure training with nREPL.
#!/bin/bash
# Script to connect to headless nrepl server with leiningen
#
#export HTTP_CLIENT="wget --no-check-certificate -O"
export LEIN_REPL_PORT=35000
export LEIN_REPL_HOST=127.0.0.1
export LEIN_JVM_OPTS=-Duser.home=$HOME
lein repl :connect $LEIN_REPL_HOST:$LEIN_REPL_PORT
@tf0054
tf0054 / core.cljs
Last active August 29, 2015 14:02 — forked from qbg/core.cljs
(ns om-tut.core
(:require [om.core :as om :include-macros true]
[om.dom :as dom :include-macros true]))
(enable-console-print!)
(def app-state (atom {:text "Works"}))
(defn handle-change
[e data edit-key owner]
http://poingg.com/burning-subtitles-to-movies-on-mac-osx-36545
ffmpeg -i sourcevideofile.mp4 -vf subtitles=mysubtitlesfile.srt outputwithsubtitles.mp4
#!/usr/bin/env inlein
'{:dependencies [[org.clojure/clojure "1.8.0"]
[com.hypirion/primes "0.2.1"]
[org.clojure/tools.logging "0.2.6"]
[org.apache.poi/poi-ooxml "3.13"]
]}
(require '[com.hypirion.primes :as p])