Skip to content

Instantly share code, notes, and snippets.

@fxp
fxp / gist:6231619
Created August 14, 2013 14:33
error when install karma "$ sudo npm -g install karma" because chinese gov blocked googlecode.com.
> phantomjs@1.9.1-4 install /usr/local/lib/node_modules/karma-phantomjs-launcher/node_modules/phantomjs
> node install.js
Downloading http://phantomjs.googlecode.com/files/phantomjs-1.9.1-macosx.zip
Saving to /usr/local/lib/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/phantomjs/phantomjs-1.9.1-macosx.zip
Receiving...
/usr/local/lib/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/install.js:215
deferred.reject('Error with http request: ' + util.inspect(response.head
^
@fxp
fxp / fxp
Created December 2, 2013 06:54
SunshineLibrary API
Sunshine Library API {#welcome}
=====================
This describes the resources published via HTTP API by [**Sunshine Library**](http://www.sunshine-library.org). If you have any problem or request please discuss in our [**branch**](http://branch.com/b/sunshine-library-tech-architecture/invite_link/B8_nBATbJxjB1Q).
> **NOTE:** This is a very early draft of what it promises
So it might be a good idea to join us :)
----------
@fxp
fxp / gist:44f963268200d6a4f4e1
Created November 2, 2014 09:36
chartjs: lose data point when .addData
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="http://www.chartjs.org/assets/Chart.min.js"></script>
</head>
<body>
<canvas id="mychart"></canvas>
<script>
@fxp
fxp / all possible value of a field
Created March 13, 2015 04:25
Get all possible value of a certain field from Leancloud
var getAllValues = function (className, fieldName) {
var promise = new AV.Promise();
var TargetClass = AV.Object.extend(className);
var values = [];
var getNextValue = function () {
var query = new AV.Query(TargetClass);
query.notContainedIn(values);
query.first().then(function (obj) {
if (obj) {
@fxp
fxp / 0_reuse_code.js
Last active August 29, 2015 14:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@fxp
fxp / install_activemq_on_aliyun.sh
Last active October 25, 2016 09:26
Install ActiveMQ on Aliyun
sudo apt-get install software-properties-common
sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
echo "export JAVA_HOME=/usr/lib/jvm/java-8-oracle/" >> ~/.bash_profile
source ~/.bash_profile
wget "http://www.apache.org/dyn/closer.cgi?filename=/activemq/5.14.0/apache-activemq-5.14.0-bin.tar.gz&action=download" -O apache-activemq-5.14.0-bin.tar.gz
tar xvfz apache-activemq-5.14.0-bin.tar.gz
cd apache-activemq-5.14.0
@fxp
fxp / gist:6b9d637040514f2e56e2637cd7c136d5
Last active September 8, 2016 08:45
ActiveMQ Ack problem
I've tried ##stomp-client##, ##stompy## to receive message from ActiveMQ.(ActiveMQ 5.14.0)
Only [##stompit##](https://www.npmjs.com/package/stompit) works for me on ack the message to remove message message from pending messages.
@fxp
fxp / note_location_on_ionicframework
Last active October 25, 2016 08:23
IonicFramework下的定位问题
很多老的Android设备都无法使用navigator定位到,试了无数的方法,最后这个插件成功了https://github.com/hewz/cordova-baidu-location
@fxp
fxp / install_java_8_on_ubuntu_14.04.sh
Created October 25, 2016 08:17
Install Java 8 on Ubuntu 14.04
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
@fxp
fxp / install_neo4j_community_on_ubuntu.sh
Created October 25, 2016 08:20
Install Neo4j community on Ubuntu
wget -O - https://debian.neo4j.org/neotechnology.gpg.key | sudo apt-key add -
echo 'deb http://debian.neo4j.org/repo stable/' | sudo tee /etc/apt/sources.list.d/neo4j.list
sudo apt-get update
sudo apt-get install neo4j