Skip to content

Instantly share code, notes, and snippets.

<dependency>
<groupId>net.sf.ucanaccess</groupId>
<artifactId>ucanaccess</artifactId>
<version>4.0.3</version>
</dependency>
https://stackoverflow.com/questions/16626301/jdbc-driver-ms-access-connection
@uangsl
uangsl / css vertical-align middle
Last active January 19, 2018 06:10
css vertical-align middle
1. Using transform and top
.valign {
position: relative;
top: 50%;
transform: translateY(-50%);
/* vendor prefixes omitted due to brevity */
}
2. Using inline-block (pseudo-)elements
.parent {
@uangsl
uangsl / iframe-loader.js
Last active September 8, 2025 16:50
load webpage by XMLHttpRequest, and insert HTML into iframe by DOMParser. then the main page can visit iframe's context without cross-domain problem
const IFRAME_READY_MESSAGE = "IFRAME_READY";
export default {
id: null,
$el: null,
iframeBaseUrl: null,
targetDocument: document,
style:{'position':'fixed', 'top': '0', 'right':'20px', 'width':'300px', 'height':'400px'},
/***
* {id: '', url: '', iframeBaseUrl:'' , style:{}, targetDocument: null}
*/
<template>
<div style='position: relative;'>
<slot></slot>
</div>
</template>
<script>
export default {
name: 'resize-observer-div',
@uangsl
uangsl / Promise.js
Created March 12, 2017 06:12
javascript Promise
new Promise(function(resolve, reject){
setTimeout(function(){
console.log("resolve", 1);
resolve("result");
}, 2000);
}).then(function(v){
return new Promise(function(resolve, reject) {
console.log("then", 2);
setTimeout(function(){
console.log("then", 3);