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 dh.tool.common; | |
import com.google.common.base.Stopwatch; | |
import com.google.common.base.Strings; | |
import org.slf4j.Logger; | |
import java.security.InvalidParameterException; | |
import java.util.concurrent.TimeUnit; | |
/** |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Try MockHttpRequest</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> | |
<!--you must to download this script to your local and replace it here--> | |
<script src="https://raw.githubusercontent.com/philikon/MockHttpRequest/master/lib/mock.js"></script> | |
</head> |
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
var sinon = require("sinon"); | |
var utils = require('../lib/utils'); | |
var xhr = sinon.useFakeXMLHttpRequest(); //in fact xhr === sinon.FakeXMLHttpRequest | |
xhr.useFilters = true; | |
xhr.addFilter(function(method, url, async, username, password) { | |
console.log('check filter on', method, url, async, username, password); | |
var parsedUrl= utils.parseUri(url); |
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> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes"> | |
<style type="text/css" media="screen"> | |
* { | |
box-sizing: border-box; | |
} |
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> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes"> | |
<style type="text/css" media="screen"> | |
* { | |
box-sizing: border-box; | |
} | |
input { |
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
<dom-module id="post-collection"> | |
<template> | |
<iron-ajax | |
auto | |
method="POST", | |
url="/backend/admin.php" | |
body='{"ignoreTemp":"true"}' | |
handle-as="json" | |
last-response="{{postsCollection}}" | |
on-response="handleResponse" |
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
<template is="dom-repeat" items={{postsCollection}}> | |
<file-item content-type="post-folder" file-name={{item}} on-tap="clickHandle"></file-item> | |
</template> | |
<script> | |
clickHandle: function(e) { | |
e.currentTarget refers to <file-item> | |
e.target refers to the div inside <file-item> | |
} | |
<script/> |
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
private void compareBtn_Click(object sender, EventArgs e) | |
{ | |
try | |
{ | |
var busyForm = new BusyForm(); | |
busyForm.Shown += async (sd, args) => | |
{ | |
try | |
{ |
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
public static class UriExtensions | |
{ | |
public static void GetUsernamePassword(this Uri uri, out string userName, out string password) | |
{ | |
userName = string.Empty; | |
password = string.Empty; | |
if (uri == null || string.IsNullOrWhiteSpace(uri.UserInfo)) | |
return; | |
var items = uri.UserInfo.Split(new[] { ':' }); |
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
[user] | |
name = duong | |
email = [email protected] | |
[core] | |
autocrlf = input | |
[alias] | |
unstage = reset -q HEAD -- | |
discard = checkout -- | |
nevermind = !git reset --hard HEAD && git clean -d -f | |
uncommit = reset --mixed HEAD~ |
OlderNewer