$ 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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%; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The boolean logical operators are : | , & , ^ , ! , || , && , == , != , ?: | |
| the OR operator | |
& the AND operator | |
^ the XOR operator | |
! the NOT operator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mop | |
class RowSet { | |
Map map = [:] | |
void update(key,value){ | |
map.put(key,value) | |
} | |
def get(key){ | |
map.get(key) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rootProject.name = 'project1' | |
archivesBaseName = 'project1' | |
jar.baseName = 'project1' | |
// -- full file | |
apply plugin: 'java' | |
apply plugin: 'maven' | |
archivesBaseName = 'project1' | |
version = '1.0-SNAPSHOT' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!("a" in window)) { | |
var a = 1; | |
} | |
alert(a); | |
var a = 1, | |
b = function a(x) { | |
x && a(--x); | |
}; |
OlderNewer