Skip to content

Instantly share code, notes, and snippets.

👏
Working hard !

Davin Kevin davinkevin

👏
Working hard !
Block or report user

Report or block davinkevin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@davinkevin
davinkevin / How long is a digest cycle ?
Last active Dec 14, 2016
Count the number of watchers in AngularJS 1 include in bookmarklet
View How long is a digest cycle ?
javascript:(function() {
if (!angular) {
alert('Not a angular application or window.angular not found');
return;
}
var entryNode = document.querySelector('[ng-app]') || document.querySelector('.ng-scope');
if (!entryNode) {
alert('No entryPoint found');
@davinkevin
davinkevin / CommunicationService.js
Last active Nov 26, 2015
AngularJS Rx replacement to $broadcast | $emit | $on
View CommunicationService.js
/**
* Created by kdavin on 24/11/2015.
*/
import {Service, Module} from '../../../decorators';
import Rx from 'rx';
@Module({
name : "app.common.services.communication"
})
@Service("CommunicationService")
View Template stars
<ul class="rating">
<li ng-repeat="star in stars" ng-class="star">
</li>
</ul>
@davinkevin
davinkevin / podcast-server.sh
Created Sep 13, 2015
init.d script podcast-server
View podcast-server.sh
#!/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
View ItemRepositoryTest.java
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;
View DatabaseConfiguraitonTest.java
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;
View tplInline.txt
template: '<ul class="rating">' +
'<li ng-repeat="star in stars" class="filled">' +
'\u2605' +
'</li>' +
'</ul>',
@davinkevin
davinkevin / ItemRepositoryTest.java
Created Aug 19, 2015
ZonedDateTime inside DBSetup
View ItemRepositoryTest.java
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;
@davinkevin
davinkevin / viewControllersInConfig
Created May 15, 2015
SpringConfiguration to catch all not already defined route
View viewControllersInConfig
@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 / MultipartFileSender
Created Feb 10, 2015
Implementing HTTP byte-range requests in Spring 4 and other framework...
View MultipartFileSender
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;
You can’t perform that action at this time.