Skip to content

Instantly share code, notes, and snippets.

View seralf's full-sized avatar
🎯
Focusing

Alfredo Serafini seralf

🎯
Focusing
View GitHub Profile
@seralf
seralf / schema.xml
Last active July 10, 2016 14:07
Start Example for a simple deduplication scenario using Solr.
<?xml version="1.0" ?>
<schema name="simple" version="1.1">
<types>
<fieldtype name="string" class="solr.StrField" />
<fieldType name="uuid" class="solr.UUIDField" indexed="true" />
</types>
<fields>
@seralf
seralf / split_pdf.sh
Last active December 16, 2015 12:08
Example command line to extract part of of a PDF file and save pages to a new PDF.
gs -sDEVICE=pdfwrite -dNOPAUSE -dBATCH -dSAFER -dFirstPage=1 -dLastPage=10 -sOutputFile=extractedFile.pdf originalFile.pdf
@seralf
seralf / split_flac.sh
Last active March 7, 2024 07:52
Simple shell script to split a single flac file using a cue file. The .flac file and .cue file must have the same name.
#!/bin/bash
sudo apt-get install cuetools shntool flac
cuebreakpoints $1.cue | shnsplit -o flac $1.flac
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<jvmArgs>-Xmx1024</jvmArgs>
<scanIntervalSeconds>10</scanIntervalSeconds>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>8888</port>
<maxIdleTime>60000</maxIdleTime>
@seralf
seralf / hello.bat
Last active December 15, 2015 22:09
Recipes for scala scripting in shell/windows :-) from the official documentation: http://www.scala-lang.org/docu/files/tools/scala.html
::#!
@echo off
call scala -savecompiled %0 %*
goto :eof
::!#
/*
* this is a scala script for Windows!
*/
Console.println("Hello, world!")
argv.toList foreach Console.println
/**
* actor wrapping access for browser socket
*/
class BrowserSocket(
val s: WebSocketConnection,
val userId: Long,
val teamId: Long
) extends Actor {
# /etc/environment
JAVA_HOME="/usr/lib/jvm/java-7-oracle"
JRE_HOME="/usr/lib/jvm/java-7-oracle/jre"
PATH="...(other path):$JAVA_HOME:$JRE_HOME"
$('.example-twitter-oss .typeahead').typeahead({
name: 'twitter-oss',
prefetch: '../data/repos.json',
template: [
'<p class="repo-language">{{language}}</p>',
'<p class="repo-name">{{name}}</p>',
'<p class="repo-description">{{description}}</p>'
].join(''),
engine: Hogan
});
$('.example-twitter-oss .typeahead').typeahead({
name: 'twitter-oss',
prefetch: '../data/repos.json',
template: [
'<p class="repo-language">{{language}}</p>',
'<p class="repo-name">{{name}}</p>',
'<p class="repo-description">{{description}}</p>'
].join(''),
engine: Hogan
});
(function($){
$.widget("ui.mywidget", {
options: {
autoOpen: true
},
_create: function(){
// by default, consider this thing closed.