Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
</body>
</html>
/*
* jQuery.ajaxQueue - A queue for ajax requests
*
* (c) 2011 Corey Frang
* Dual licensed under the MIT and GPL licenses.
*
* Requires jQuery 1.5+
*/
(function($) {
@SansWord
SansWord / completion-for-gradle.md
Last active August 29, 2015 14:23 — forked from nolanlawson/completion-for-gradle.md
some change to clear cache and consider of timestamp

Gradle tab completion script for Bash

A tab completion script that works for Bash. Relies on the BSD md5 command on Mac and md5sum on Linux, so as long as you have one of those two commands, this should work.

Usage

$ gradle [TAB]
@SansWord
SansWord / lookup_fortune_calendar.js
Last active August 29, 2015 14:27
Dump fortune of each day using javascript.
/*jslint indent: 4 */
/*global
jQuery: false,
alert: false,
window: false,
queryNext: false,
*/
/**
* dump fortune of each day using javascript.
根據題目分析,先按照餘數分類:
假設答案為 N
mod 1,3,7,9 餘 0 ........ (1)
mod 2,4,5,8 餘 1 ........ (2)
mod 6 餘 3 .............. (3)
lcm(3,7,9) = 63 ......... (4), by (1)
lcm(2,4,5,8) = 40 ....... (5), by (2)
N ≡ 0 mod 63 ..... (6), by (4)
@SansWord
SansWord / Base Descriptions
Last active July 3, 2016 22:48
Compares methods to literate over a list
Compares methods to literate over a list:
The following codes all do the same things:
Given a list of ticket,
1. put ticket into a map.
2. count the number of ticket which status is BOUGNT, initial an AtomicInteger with the count of bought tickets.
@SansWord
SansWord / genkey.sh
Last active August 9, 2016 07:55 — forked from xcooper/genkey.sh
Generate private key, certification request, optional PEM files at once
#!/bin/sh
echo "edit this file before you execute it!!"
echo "make sure keytool and openssl commands are in PATH"
read -p "Contiune?" ANS
read -p "give me CN(www.xxx.com.tw)" CN
read -s -p "give me default password(length >= 8)" PASS
set -e
# Edit these arguments
package test;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* Created by sansword on 2017/1/28.
*/
public class ForEachPerformanceTest {
question 1
When were we chosen? (1:4-5,11)
我們什麼時候被上帝揀選為聖徒?
A 我們信的時候 When we believed
B 我們受洗的時候 When we were baptized
C 我們受聖靈的時候 When we received the Spirit
D 我們悔改的時候 When we repented(悔改)
E! 上帝創立世界以前 Before the foundation of the world
question 2
def parallelExecute(List<Closure> executions) {
def results = []
def threads = []
executions.collect { execution ->
def th = new Thread({
results.add(execution())
})
threads.add(th)
}
threads.each { it.start() }