Skip to content

Instantly share code, notes, and snippets.

$ brew install selenium-server-standalone chromedriver
$ git clone git@github.com:theintern/intern.git
$ cd intern
$ npm install --production
$ ln -s .. node_modules/intern
$ curl https://gist.github.com/neonstalwart/6630466/raw/f0e4e4efbefa40c746f7c68e2bb4fa0dd5215047/selftest.local.intern.js > tests/selftest.local.intern.js
$ java -jar /usr/local/opt/selenium-server-standalone/selenium-server-standalone-2.35.0.jar -p 4444 &
$ node node_modules/intern/runner.js config=tests/selftest.local.intern
# Modify /etc/yum.repos.d/epel.repo. Under the section marked [epel], change enabled=0 to enabled=1.
sudo yum install erlang --enablerepo=epel
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.1/rabbitmq-server-3.1.1-1.noarch.rpm
sudo rpm -Uvh rabbitmq-server-3.1.1-1.noarch.rpm
# Enable managament plugin
sudo rabbitmq-plugins enable rabbitmq_management
@alanland
alanland / index.html
Last active December 17, 2015 23:58
仓位图
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="storeroom.js"></script>
<style>
body, html, #allmap {
width: 100%;
height: 100%;
@alanland
alanland / joda-time
Created June 27, 2013 03:28
joda-time 例子
//Joda-Time 的一个小例子,计算一天的工作时间,
//每天工作8小时,1小时休息:
package com.alzhang.workingtime;
import org.joda.time.DateTime;
import org.joda.time.Duration;
import org.joda.time.Hours;
import org.joda.time.Period;
import org.joda.time.format.DateTimeFormat;
@alanland
alanland / boolean.java
Created June 28, 2013 04:38
Java Boolean 操作符
The boolean logical operators are : | , & , ^ , ! , || , && , == , != , ?:
| the OR operator
& the AND operator
^ the XOR operator
! the NOT operator
@alanland
alanland / RowSet.groovy
Last active December 19, 2015 10:09
Groovy MOP
package mop
class RowSet {
Map map = [:]
void update(key,value){
map.put(key,value)
}
def get(key){
map.get(key)
}
@alanland
alanland / timeout.js
Created July 24, 2013 06:35
Javascript 延迟
//Call a javascript function after 5 sec of last key press
var timeout;
$(document).ready(function(){
$('input[type=text]').keypress(function() {
if(timeout) {
clearTimeout(timeout);
timeout = null;
}
timeout = setTimeout(myFunction, 5000);
@alanland
alanland / client-data.html
Last active December 20, 2015 06:29
gridx
<script type="text/javascript">
require([
"gridx/Grid",
"gridx/core/model/cache/Sync",
"gridx/modules/VirtualVScroller",
"gridx/modules/ColumnResizer",
"gridx/modules/extendedSelect/Row",
"gridx/modules/SingleSort",
"dojo/store/Memory"
], function(){
@alanland
alanland / build.gradle
Created August 6, 2013 02:36
Gradle Setting
rootProject.name = 'project1'
archivesBaseName = 'project1'
jar.baseName = 'project1'
// -- full file
apply plugin: 'java'
apply plugin: 'maven'
archivesBaseName = 'project1'
version = '1.0-SNAPSHOT'
@alanland
alanland / DoYouKnowJs.js
Created August 6, 2013 04:08
So, you think you know JavaScript?
if (!("a" in window)) {
var a = 1;
}
alert(a);
var a = 1,
b = function a(x) {
x && a(--x);
};