Skip to content

Instantly share code, notes, and snippets.

View yblee85's full-sized avatar

Yunbo Lee yblee85

  • Toronto, Canada
View GitHub Profile
@yblee85
yblee85 / gist:832b82999a00768c28e7
Last active March 16, 2016 20:37
Install CouchDB 1.6.1 on Ubuntu 14.04 (origin : pixelpark/ppnet)
# via http://wiki.apache.org/couchdb/Installing_on_Ubuntu
sudo apt-get install --yes build-essential curl git
sudo apt-get install --yes python-software-properties python g++ make
sudo apt-get install -y erlang-dev erlang-manpages erlang-base-hipe erlang-eunit erlang-nox erlang-xmerl erlang-inets
sudo apt-get install -y libmozjs185-dev libicu-dev libcurl4-gnutls-dev libtool
# via http://ftp.fau.de/apache/couchdb/source/1.6.1/
cd /tmp
@yblee85
yblee85 / gist:5331826
Created April 7, 2013 18:38
dzi code
just in case, dzi example code below.
/******************************* index.html *****************************************/
<!DOCTYPE html>
<html ng-app="angularjs-starter">
<head lang="en">
<meta charset="utf-8">
<title>Custom Plunker</title>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script>
http://plnkr.co/edit/Kl0lYAY3O2goy5Ar4w6B?s=MJhcYoHefpn9524Z
fork from
http://plnkr.co/edit/fvD0FZBr81dtq3bjY15o?s=MJhcYoHefpn9524Z
deepzoom_image
wheel roll up/down functions work. watch seems to be not working.
=CRASH REPORT==== 21-Nov-2011::18:14:39 ===
crasher:
initial call: couch_rep:init/1
pid: <0.14013.0>
registered_name: []
exception exit: {{badmatch,{error,{changes_error_code,400}}},
[{couch_rep,do_init,1},
{couch_rep,init,1},
{gen_server,init_it,6},
{proc_lib,init_p_do_apply,3}]}
@yblee85
yblee85 / updateFavicon.js
Created September 23, 2015 21:48
update favicon dynamically
function updateFavicon(faviconURL) {
var src = faviconURL;
var head_node = document.head || document.getElementsByTagName('head')[0];
var link = document.createElement('link'),
oldLink = document.getElementById('favicon');
link.id = 'favicon';
link.rel = 'shortcut icon';
link.href = src;
if (oldLink) {
head_node.removeChild(oldLink);
@yblee85
yblee85 / includeCSS.js
Created September 23, 2015 21:47
include CSS file / add new CSS
function includeCSSfile(href) {
var head_node = document.head || document.getElementsByTagName('head')[0];
var link_tag = document.createElement('link');
link_tag.setAttribute('rel', 'stylesheet');
link_tag.setAttribute('type', 'text/css');
link_tag.setAttribute('href', href);
head_node.appendChild(link_tag);
}
@yblee85
yblee85 / gist:50da5b708b7c7470762c
Created September 17, 2015 16:20
Bootable USB from directory in Windows
//command line
diskpart
//diskpart command line
list disk
//it will show disk
// disk0, 1, 2
select disk 2
clean
@yblee85
yblee85 / gist:fe57ed6e32c8d102d365
Last active August 29, 2015 14:13
creating service in ubuntu 12.04
// origin : askubuntu.com (http://askubuntu.com/questions/351879/how-to-create-a-service-on-ubuntu-lts-12-04)
// about upstart manual : http://upstart.ubuntu.com/cookbook
Upstart scripts have to placed at /etc/init, ending with .conf.
Basically they require 2 sessions: one to indicate when to start, and another with the command to exec.
The easiest script to start with your sample is:
# myprogram.conf
{
"analyzer": "class org.apache.lucene.analysis.standard.StandardAnalyzer",
"etag": "136aa9854e3df",
"fetch_duration": 0,
"limit": 31,
"plan": "BooleanQuery(TermQuery(desc_upc_cat_sup:koka,boost=1.0)+TermQuery(default:kola,boost=1.0)+TermQuery(locid:88c6b2ca7d76cc613907149e505c5eff,boost=1.0),boost=1.0)",
"q": "desc_upc_cat_sup:koka +default:kola +locid:88c6b2ca7d76cc613907149e505c5eff",
"rows": [],
"search_duration": 0,
"skip": 0,
@yblee85
yblee85 / gist:fb23b1867b0eea2f5d1a
Last active August 29, 2015 14:01
JAVA multiline label html no border
// you can set border / cellpadding and other stuffs so that this content fits JTable or JLabel
"<html><table width=\"115\"; border=\"0\"; cellpadding=\"0\"; cellspacing=\"0\"; margin-top=\"0\"; margin-bottom=\"0\"; padding=\"0\" \"><tr><td align=\"center\">" + work_hour + "</td></tr><tr><td align=\"center\"><font size=\"2\">" + startTimeAMPM + "~" + endTimeAMPM + "</font></td></tr></table></html>"