Skip to content

Instantly share code, notes, and snippets.

View lianyi's full-sized avatar

lianyi lianyi

View GitHub Profile
@lianyi
lianyi / README.md
Last active February 4, 2016 15:32 — forked from mbostock/.block
force-directed graph

This simple force-directed graph shows character co-occurence in Les Misérables. A physical simulation of charged particles and springs places related characters in closer proximity, while unrelated characters are farther apart. Layout algorithm inspired by Tim Dwyer and Thomas Jakobsen. Data based on character coappearence in Victor Hugo's Les Misérables, compiled by Donald Knuth.

Compare this display to a force layout with curved links, a force layout with fisheye distortion and a matrix diagram.

/*Custom Radio Buttons and Checkboxes using Font Awesome*/
input[type=radio],
input[type='checkbox'] {
display: none;
}
input[type=radio] + label {
display: block;
}
input[type='checkbox'] + label:before,
[
{
"key": 1,
"value": 4.47
},
{
"key": 2,
"value": 8.42
},
{
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.filefilter.TrueFileFilter;
import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.core.CoreContainer;
@lianyi
lianyi / Install passport-ldapauth
Last active October 17, 2017 18:26 — forked from smithkyle/Install passport-ldapauth
MEAN.js passport-ldapauth integration
npm install -S passport-ldapauth
@lianyi
lianyi / Jetty IP restriction.md
Last active August 29, 2015 14:27
Jetty(SOLR) Configuration for IP restrictions

Usage

java -jar start.jar etc/jetty.xml etc/iprestriction.xml

Notes

The idea is to use mixin to isolate ip configurations without touching the main configuration file.

#Versions tested:

@lianyi
lianyi / run.sh
Created September 10, 2015 13:19
runsolr.sh
git clone https://github.com/NCBI-Hackathons/seqr.git
cd seqr/testdata
# to install and start a solr instance using the makefile located in seqr/testdata
make
# To install the server without starting it:
make install
# To stop a server started from make:
@lianyi
lianyi / EarthScene.js
Last active February 8, 2016 18:51
Hologram Earth
/**
* Earth and Scene
*
* @constructor
*/
function EarthScene() {
//create scene
this.scene = new THREE.Scene();
this.textureloader = new THREE.TextureLoader();
this.renderer = new THREE.WebGLRenderer();
@lianyi
lianyi / geo_usstates.js
Last active April 11, 2016 18:32 — forked from mshafrir/states_hash.json
US states in JSON and JS format
var geo_usstates = {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"id": "01",
"properties": {
"name": "AL"
},
"geometry": {
@lianyi
lianyi / jquery.waituntilexists.js
Created April 30, 2016 16:52 — forked from PizzaBrandon/jquery.waituntilexists.js
Updated waitUntilExists plugin
;(function ($, window) {
var intervals = {};
var removeListener = function(selector) {
if (intervals[selector]) {
window.clearInterval(intervals[selector]);
intervals[selector] = null;
}