Skip to content

Instantly share code, notes, and snippets.

Liang Cai coronin

Block or report user

Report or block coronin

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
@coronin
coronin / srtTranslate.py
Last active Jun 24, 2019
I used the following to generate **Three.Seconds.zh-en.srt**
View srtTranslate.py
## Liang Cai, 2019-6-22
import time
import translation
def translate_line(a):
time.sleep(1)
try:
b = translation.iciba(a, dst = 'zh') # @@@@
@coronin
coronin / osx_install.sh
Last active Jun 28, 2016 — forked from t-io/osx_install.sh
Install most of my Apps with homebrew & cask
View osx_install.sh
#!/bin/sh
echo Install all AppStore Apps at first!
# no solution to automate AppStore installs
read -p "Press any key to continue... " -n1 -s
echo '\n'
echo Install Homebrew, Postgres, wget and cask
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew tap homebrew/science
brew install wget
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@coronin
coronin / auto_crispr_scanner.js
Created Oct 22, 2015
run via phantomjs (bug: the bar display)
View auto_crispr_scanner.js
var page = require('webpage').create();
page.viewportSize = { width: 1024, height: 768 };
// console.log('Request cripspr scanner as ' + page.settings.userAgent);
var sp = 'human', // only allow: human mouse dog
seq = 'ggaggaagggcctgagtccgagcagaagaagaagggctcccatcacatcaaccggtggcgcattgccacgaagcaggccaatggggaggacatcgatgtcacctccaatgactagggtgggc';
page.open('http://xx.cail.cn/crispr.html?sp='+sp+'&seq='+seq, function() {
var data = page.evaluate(function () {
return document.querySelector('span#server_status').innerText;
@coronin
coronin / excel2wiki.php
Created Oct 4, 2014
from Internet, excel to wiki
View excel2wiki.php
<!--
Copyright (c) 2010 Shawn M. Douglas (shawndouglas.com)
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
@coronin
coronin / table2col.php
Last active Aug 29, 2015
copy cells from Excel to get them in a column
View table2col.php
<!--
Copyright (c) 2014 Liang Cai (cailiang.net)
Inspired by 2010 Shawn M. Douglas (shawndouglas.com)
-->
<?php
echo "<html>
<head><title>table2col | Excel xls, table to column copy and paste converter</title></head>
<body><h1>Copy &amp; Paste Table-to-Column Converter</h1>
<form action='table2col.php' method='post'>
@coronin
coronin / ots_server.patch
Last active Aug 29, 2015
patch to htgt/CRISPR-Analyser
View ots_server.patch
diff --git a/src/crisprutil.cpp b/src/crisprutil.cpp
index 91d9b4c..0480e27 100644
--- a/src/crisprutil.cpp
+++ b/src/crisprutil.cpp
@@ -44,6 +44,10 @@ void CrisprUtil::_populate_cmap() {
string CrisprUtil::get_crispr(uint64_t id) {
return util::bits_to_string( get_crispr_int(id), crispr_data.seq_length );
}
+// 2014-9-9 : id with offset need to be correct
+string CrisprUtil::get_offset_crispr(uint64_t id) {
@coronin
coronin / crispr.html
Last active Aug 29, 2015
run nicely with ots_server and Web Blat
View crispr.html
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>crispr scanner, made by Liang Cai</title>
<style type="text/css" media="screen"><!--
body{margin:25px;padding:0;font-family:Arial,Helvetica,sans-serif;font-size:100%;line-height:1.5}
article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}
h1,h2,h3,h4{margin:1em 0 .5em;line-height:1.25;font-weight:700}
h1{font-size:2em}
View .screenrc
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off
@coronin
coronin / chat-frontend.js
Created Apr 15, 2012 — forked from martinsik/chat-frontend.js
Node.js chat frontend and server
View chat-frontend.js
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
You can’t perform that action at this time.