Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View davinkevin's full-sized avatar
👋
Working hard !

Davin Kevin davinkevin

👋
Working hard !
View GitHub Profile
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# Modification made for Mac OS X 10.7.4
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -r -c AppleDisplay`
edid_hex=data.match(/IODisplayEDID.*<(.+)/i)[1]
@davinkevin
davinkevin / vGetTest.java
Created January 25, 2015 18:58
Test to download youtube video with vget 1.1.22
package lan.dk.podcastserver.worker.downloader;
import com.github.axet.vget.VGet;
import com.github.axet.vget.info.VGetParser;
import com.github.axet.vget.info.VideoInfo;
import com.github.axet.vget.vhs.VimeoInfo;
import com.github.axet.vget.vhs.YoutubeInfo;
import com.github.axet.wget.info.DownloadInfo;
import org.junit.Test;
@davinkevin
davinkevin / MultipartFileSender
Created February 10, 2015 16:31
Implementing HTTP byte-range requests in Spring 4 and other framework...
package lan.dk.podcastserver.utils.multipart;
import lan.dk.podcastserver.utils.MimeTypeUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@davinkevin
davinkevin / viewControllersInConfig
Created May 15, 2015 22:47
SpringConfiguration to catch all not already defined route
@Configuration
@ComponentScan("lan.dk.podcastserver.controller")
public class WebMvcConfig extends WebMvcConfigurerAdapter {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/").setViewName("index.html"); // Same thing without this line
registry.addViewController("/**").setViewName("index.html");
super.addViewControllers(registry); // and this line...
}
@davinkevin
davinkevin / ItemRepositoryTest.java
Created August 19, 2015 04:06
ZonedDateTime inside DBSetup
package lan.dk.podcastserver.repository;
import com.ninja_squad.dbsetup.DbSetup;
import com.ninja_squad.dbsetup.DbSetupTracker;
import com.ninja_squad.dbsetup.destination.DataSourceDestination;
import com.ninja_squad.dbsetup.destination.Destination;
import com.ninja_squad.dbsetup.operation.Operation;
import lan.dk.podcastserver.entity.Item;
import lan.dk.podcastserver.entity.Status;
import org.junit.Before;
template: '<ul class="rating">' +
'<li ng-repeat="star in stars" class="filled">' +
'\u2605' +
'</li>' +
'</ul>',
@davinkevin
davinkevin / DatabaseConfiguraitonTest.java
Created September 5, 2015 11:04
Init of Repository Test
package lan.dk.podcastserver.repository;
import com.ninja_squad.dbsetup.operation.Operation;
import org.hibernate.search.jpa.FullTextEntityManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.orm.jpa.EntityScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
@davinkevin
davinkevin / ItemRepositoryTest.java
Created September 5, 2015 11:04
ItemRepositoryTest
package lan.dk.podcastserver.repository;
import com.ninja_squad.dbsetup.DbSetup;
import com.ninja_squad.dbsetup.DbSetupTracker;
import com.ninja_squad.dbsetup.destination.DataSourceDestination;
import com.ninja_squad.dbsetup.operation.Operation;
import lan.dk.podcastserver.entity.Item;
import lan.dk.podcastserver.entity.ItemAssert;
import lan.dk.podcastserver.entity.Status;
import lan.dk.podcastserver.manager.worker.updater.AbstractUpdater;
@davinkevin
davinkevin / podcast-server.sh
Created September 13, 2015 16:56
init.d script podcast-server
#!/bin/bash
#
# Podcast-Server This shell script takes care of starting and stopping Tomcat
#
# chkconfig: - 80 20
#
### BEGIN INIT INFO
# Provides: podcast-server
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
<ul class="rating">
<li ng-repeat="star in stars" ng-class="star">
</li>
</ul>