Skip to content

Instantly share code, notes, and snippets.

View ivanfioravanti's full-sized avatar

Ivan Fioravanti ivanfioravanti

View GitHub Profile
1.CentOS 6.4
#yum groupinstall "Development tools"
$wget http://redis.googlecode.com/files/redis-2.6.14.tar.gz
$tar zxf redis-2.6.14.tar.gz
$cd redis-2.6.14
$make
$make install
//////
mkdir -p /usr/local/bin
#!/bin/sh
# http://vm-192-168-11-21.shengyun.grandcloud.cn/topics/2437
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: 2345 90 10
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid
# my copy redis.conf
# changes
# 1. dir
# 2. daemonize yes
# 3. maxmenory 100MB
# 4. logfile /var/log/redis.log
#
#
# Redis configuration file example
#
@Component
class PaginatedResultsRetrievedEventDiscoverabilityListener implements ApplicationListener< PaginatedResultsRetrievedEvent >{
@Override
public void onApplicationEvent( PaginatedResultsRetrievedEvent ev ){
Preconditions.checkNotNull( ev );
this.addLinkHeaderOnPagedResourceRetrieval(
ev.getUriBuilder(), ev.getResponse(), ev.getClazz(), ev.getPage(), ev.getTotalPages(), ev.getPageSize() );
}
void addLinkHeaderOnPagedResourceRetrieval( UriComponentsBuilder uriBuilder, HttpServletResponse response,
@ivanfioravanti
ivanfioravanti / gist:5268017
Last active December 15, 2015 13:29 — forked from efbenson/gist:4259486
Automapper for MongoDB ObjectIds
Mapper.CreateMap<List<ObjectId>, List<string>>().ConvertUsing(o => o.Select(os => os.ToString()).ToList());
Mapper.CreateMap<List<string>, List<ObjectId>>().ConvertUsing(o => o.Select(os => ObjectId.Parse(os)).ToList());
Mapper.CreateMap<ObjectId, string>().ConvertUsing(o => o.ToString());
Mapper.CreateMap<string, ObjectId>().ConvertUsing(s => ObjectId.Parse(s));
@ivanfioravanti
ivanfioravanti / gist:6839198
Created October 5, 2013 10:21
elastisearch Dockerfile
FROM ubuntu
MAINTAINER ivanfioravanti "[email protected]"
# Java 7
RUN echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
RUN apt-get update
RUN echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
RUN apt-get install oracle-java7-installer -y
@ivanfioravanti
ivanfioravanti / gist:7156336
Created October 25, 2013 15:15
MongoDB c# Case insensitive search
MongoDB, c#: Case insensitive search
Query.Matches("FirstName", BsonRegularExpression.Create(new Regex(searchKey,RegexOptions.IgnoreCase)));
Query.Matches("FieldName", BsonRegularExpression.Create(new Regex(searchKey, RegexOptions.IgnoreCase)))
public User FindByEmail(Email email)
{
return session.GetCollection<User>().AsQueryable()
.Where(u => u.EmailAddress.ToLower() == email.Address.ToLower()).FirstOrDefault();
}
@ivanfioravanti
ivanfioravanti / d3.js
Created December 28, 2013 17:04 — forked from auser/d3.js
angular.module('d3', [])
.factory('d3Service', ['$document', '$window', '$q', '$rootScope',
function($document, $window, $q, $rootScope) {
var d = $q.defer(),
d3service = {
d3: function() { return d.promise; }
};
function onScriptLoad() {
// Load client in the browser
$rootScope.$apply(function() { d.resolve($window.d3); });
@ivanfioravanti
ivanfioravanti / kibana
Last active August 29, 2015 14:16
kibana init.d
#!/bin/sh
#
# /etc/init.d/kibana4_init -- startup script for kibana4
# [email protected] 2015-02-20; used elasticsearch init script as template
# https://github.com/akabdog/scripts/edit/master/kibana4_init
#
### BEGIN INIT INFO
# Provides: kibana4
# Required-Start: $network $remote_fs $named
# Required-Stop: $network $remote_fs $named
@ivanfioravanti
ivanfioravanti / sd_webp_workflow.json
Created November 27, 2023 06:56
(basic) ComfyUI Stable Video Diffusion workflow webp
{
"last_node_id": 25,
"last_link_id": 43,
"nodes": [
{
"id": 14,
"type": "VideoLinearCFGGuidance",
"pos": [
487.799932861328,
265.6999450683599