This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Mojolicious::Lite; | |
use Text::Markdown qw/markdown/; | |
get '/' => sub { | |
my $self = shift; | |
$self->render('index'); | |
}; | |
get '/markdown' => sub { | |
my $self = shift; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.ck</groupId> | |
<artifactId>bioweb</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<name>bio</name> | |
<description></description> | |
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH RECURSIVE node_rec(id, name, parent, type) as ( | |
-- Non-recursive term | |
( | |
select id, name, parent, type from node where id = 566 | |
) | |
UNION ALL | |
-- Recursive Term | |
-- Here I use 'UNION ALL' statement so that the duplicate result will be included. | |
-- You can choose to use 'UNION' instead of 'UNION ALL' to get distinct data. | |
( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Show current sequence val | |
select currval('nodefolder_id_seq'::regclass); | |
-- Let insert the data with currval as value | |
BEGIN; | |
insert into node (name,parent,type, project_id) | |
values ('TEST_Name',null,1,currval('nodefolder_id_seq'::regclass)); | |
COMMIT; | |
-- Reference |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: http://stackoverflow.com/questions/10490570/call-angular-js-from-legacy-code | |
var scope = angular.element($('#todoList')[0]).scope() | |
// The original behavior of click will add up a variable with 1 and show it on the view, but it fact it doesn't update the veiw until | |
// user click the UI to trigger this function | |
scope.clikc(); | |
// If I do it in this way, the result will the same with my expect | |
scope.$apply(function() { | |
scope.click(); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
tree = "forest --pretty=format:\"%C(red)%h %C(magenta)(%ar) %C(blue)%an %C(reset)%s\" --style=15 --reverse --all" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
messageBox.show = function(infoNodeId, PositionNodeId) { | |
var title = jstree().messageBoxTitle(infoNodeId); | |
var content = jstree().messageBoxText(infoNodeId, PositionNodeId); | |
}; | |
//------ | |
contextMenu.delete_node = function(node) { | |
this.popupMessage.show(node.id, node.id); | |
this.popupMessage.loading.done(function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ibms.gp.bioinfo.monitor.util; | |
import org.apache.commons.lang.builder.HashCodeBuilder; | |
public class ColInfo { | |
private String name; | |
private String type; | |
private String modifier; | |
public ColInfo (String name, String type, String modifier) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.ck.server; | |
import io.netty.bootstrap.ServerBootstrap; | |
import io.netty.channel.ChannelFuture; | |
import io.netty.channel.ChannelInitializer; | |
import io.netty.channel.ChannelOption; | |
import io.netty.channel.EventLoopGroup; | |
import io.netty.channel.FixedRecvByteBufAllocator; | |
import io.netty.channel.nio.NioEventLoopGroup; | |
import io.netty.channel.socket.SocketChannel; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.rabbitmq.client.ConnectionFactory; | |
import com.rabbitmq.client.Connection; | |
import com.rabbitmq.client.Envelope; | |
import com.rabbitmq.client.AMQP; | |
import java.util.concurrent.TimeoutException; | |
import com.rabbitmq.client.Channel; | |
import com.rabbitmq.client.Consumer; | |
import com.rabbitmq.client.DefaultConsumer; |