Skip to content

Instantly share code, notes, and snippets.

View Soontao's full-sized avatar
😊
I may be slow to respond.

Theo Sun Soontao

😊
I may be slow to respond.
View GitHub Profile
Joe Armstrong:
面向对象语言的问题是,它们永远都要随身携带那些隐式的环境。
你只需要一个香蕉,但却得到一个拿着香蕉的大猩猩...以及整个丛林
@Soontao
Soontao / HttpServerSample.java
Last active August 30, 2017 05:00
Http Server Sample with java 8 lambda
import java.io.IOException;
import java.net.InetSocketAddress;
import com.sun.net.httpserver.HttpServer;
public class HttpServerSample {
public static void main(String[] args) throws IOException {
HttpServer server = HttpServer.create(new InetSocketAddress(8080), 0);
server.createContext("/", exchange -> {
@Soontao
Soontao / HierarchyPicker.js
Created March 7, 2018 14:18
HierarchyPicker
import { View, Text, FlatList, TouchableOpacity, ListRenderItem } from "react-native";
import React, { Component } from "react";
import { map } from "lodash";
import { ViewPager } from "rn-viewpager";
interface Page<T> {
keyExtractor?: (item: T) => any;
data?: T[];
renderItem?: ListRenderItem<T>;
renderPage?: (prePage, nextPage) => JSX.Element;
{
"master_password" : "ChangedThis01"
}
@Soontao
Soontao / JSONBindingPatch.js
Created May 27, 2019 09:22
UI5 JSON Property Binding Patch
import JSONPropertyBinding from "sap/ui/model/json/JSONPropertyBinding";
import JSONModel from "sap/ui/model/json/JSONModel";
import { forEach, isEqual } from "lodash";
/**
* overwrite set property logic
*/
JSONModel.prototype.setProperty = function(sPath, oValue, oContext, bAsyncUpdate) {
var sResolvedPath = this.resolve(sPath, oContext),
@Soontao
Soontao / EChartsControl.js
Last active September 3, 2019 07:01
EChartsControl
import Control from "sap/ui/core/Control";
import echarts from "echarts";
import RenderManager from "sap/ui/core/RenderManager";
const E_CHARTS = "e_chart";
export default class EChartsControl extends Control {
metadata = {
properties: {
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Monaco Demo</title>
<script src="https://cdn.bootcss.com/require.js/2.3.6/require.min.js"></script>
</head>
#!/bin/bash
go get -u -v golang.org/x/tools/cmd/gopls
go get -u -v github.com/ramya-rao-a/go-outline
go get -u -v github.com/acroca/go-symbols
go get -u -v github.com/mdempsky/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v golang.org/x/tools/cmd/godoc
go get -u -v github.com/zmb3/gogetdoc
go get -u -v golang.org/x/lint/golint
go get -u -v github.com/fatih/gomodifytags
// Add additonal d.ts files to the JavaScript language service and change.
// Also change the default compilation options.
// The sample below shows how a class Facts is declared and introduced
// to the system and how the compiler is told to use ES6 (target=2).
// validation settings
monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
noSemanticValidation: true,
noSyntaxValidation: false
});
Word.run((ctx) => {
Office.context.document.addHandlerAsync(Office.EventType.DocumentSelectionChanged, (e) => {
console.log(e)
})
return ctx.sync()
})