Skip to content

Instantly share code, notes, and snippets.

@s4553711
s4553711 / gist:3656034
Created September 6, 2012 13:04
CKeditor Plugin: Combo
CKEDITOR.plugins.add( 'tokens',
{
requires : ['richcombo'], //, 'styles' ],
init : function( editor )
{
var config = editor.config,
lang = editor.lang.format;
// Gets the list of tags from the settings.
var tags = []; //new Array();
@s4553711
s4553711 / ansi-color.php
Created September 11, 2012 03:58 — forked from superbrothers/ansi-color.php
ANSI color terminal output module for php
<?php
/**
* php-ansi-color
*
* Original
* https://github.com/loopj/commonjs-ansi-color
*
* @code
* <?php
* require_once "ansi-color.php";
@s4553711
s4553711 / gist:3785727
Created September 26, 2012 02:51
XML::Path Example for parsing uniprot data
#!/usr/bin/perl
use XML::XPath;
use XML::XPath::XMLParser;
use WWW::Mechanize;
# To get the unirprot data through WWW::Mechanize
my $w = WWW::Mechanize->new();
$w->get("http://www.uniprot.org/uniprot/P05067.xml");
# Initial
@s4553711
s4553711 / gist:3833600
Created October 4, 2012 13:42
Plack example
#!/usr/bin/perl
my $app = sub {
my $env = shift;
my $html = "<h1>This is created by Plack</h1>";
return [ 200 ,
[ 'Content-type' => 'text/html', 'charset' => 'utf-8' ] ,
[ $html ] ];
@s4553711
s4553711 / dabblet.css
Created December 28, 2012 09:34
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
*{
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
}
div.bk{
background: linear-gradient(60deg, yellow, blue);
#!/usr/bin/perl
package PJProcess;
use base qw( TheSchwartz::Worker TheSchwartz::Job );
sub work {
my $class = shift;
my TheSchwartz::Job $job = shift;
...
$job->completed();
}
1;
#!/usr/bin/perl
use Process1;
use Process2;
use base qw( TheSchwartz );
my $client = TheSchwartz->new( databases => $setting);
$client->can_do('Process1');
$client->can_do('Process2');
$client->work();
@s4553711
s4553711 / gist:4737324
Created February 8, 2013 07:42
JSON in Java
import org.json.*;
public static void main(String[] args) {
// Declare Hashtable
Hashtable stor = new Hashtable();
stor.put("Keya","a");
stor.put("keyb","b")
// Declare JSONObject and initialization with stor
JSONObject jsonObject = new JSONObject(stor);
// Output
@s4553711
s4553711 / gist:5167381
Created March 15, 2013 03:57
Render a picture in non-public folder in Mojolicious
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub {
my $self = shift;
$self->render('clock');
};
get '/pic' => sub {
my $self = shift;
@s4553711
s4553711 / blast.java
Created June 16, 2013 16:39
A simple program for submitting ncbi blast search in Java
package Bio;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URL;
import java.util.Hashtable;