- Python 3
- Pip 3
$ brew install python3
<h1>Handle paste clipboard from excel by JS</h1> | |
<div id='out'></div> | |
<script> | |
// https://stackoverflow.com/a/38326762/466693 | |
document.addEventListener('paste', function (event) { | |
window.clipText = event.clipboardData.getData('Text'); | |
render_table(clipText); | |
}); |
// https://alvinalexander.com/android/how-to-create-android-notifications-notificationmanager-examples | |
public void showNotification(String s){ | |
PendingIntent pi = PendingIntent.getActivity(this, 0, new Intent(this, MainActivity.class), 0); | |
Notification notification = new NotificationCompat.Builder(this) | |
.setTicker("Demo") | |
.setSmallIcon(android.R.drawable.ic_menu_help) | |
.setContentTitle("Demo Notification") | |
.setContentText(s) | |
.setContentIntent(pi) | |
.setAutoCancel(true) |
// utility | |
function stamp_time(text){ | |
console.log(new Date().toLocaleTimeString(), text); | |
} | |
// mock process | |
function make_double(v){ | |
return new Promise(function(res, rej){ | |
setTimeout(x => { | |
res(v*2); // double value |
{ | |
"window.zoomLevel": 0, | |
"vim.disableAnnoyingNeovimMessage": true, | |
"window.menuBarVisibility": "toggle", | |
"editor.fontFamily": "Droid Sans Mono", | |
"editor.fontSize": 15, | |
"workbench.colorTheme": "Sublime Material Theme - Dark", | |
"workbench.colorCustomizations": { | |
"editor.background": "#000" | |
} |
[Groups] | |
NumberOfGroups = 8 | |
[1] | |
TriggerTop = [Monitor1Top] | |
TriggerRight = [Monitor1Left] + [Monitor1Width] /2 | |
TriggerBottom = [Monitor1Top] + [Monitor1Height] /2 | |
TriggerLeft = [Monitor1Left] |
// http://stackoverflow.com/questions/23945494/use-html5-to-resize-an-image-before-upload | |
var IMGRZ_MAX_WIDTH = 500; | |
/* Utility function to convert a canvas to a BLOB */ | |
var dataURLToBlob = function(dataURL) { | |
var BASE64_MARKER = ';base64,'; | |
if (dataURL.indexOf(BASE64_MARKER) == -1) { | |
var parts = dataURL.split(','); | |
var contentType = parts[0].split(':')[1]; |
// https://github.com/fengyuanchen/datepicker | |
$('#from_date').datepicker({ | |
format: 'yyyy-mm-dd', | |
}); | |
$('#to_date').datepicker({ | |
format: 'yyyy-mm-dd', | |
}); | |
$('#from_date').change(function(){ | |
$('#to_date').datepicker('setStartDate', $(this).val()); | |
}); |
function jsonPost(url, data, callback){ | |
$.ajax({ | |
'url': url, | |
'type': 'post', | |
'contentType': 'application/json; charset=utf-8', | |
'dataType': 'json', | |
'data': JSON.stringify(data), | |
'success': function(a, b, c){ | |
callback(a, b, c); | |
} |