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
import sublime, sublime_plugin | |
class ExampleCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
self.view.insert(edit, 0, "Hello, World!") |
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
CREATE FUNCTION extended_sales(p_itemno int) | |
RETURNS TABLE(quantity int, total numeric) AS $$ | |
BEGIN | |
RETURN QUERY SELECT s.quantity, s.quantity * s.price FROM sales AS s | |
WHERE s.itemno = p_itemno; | |
END; | |
$$ LANGUAGE plpgsql; |
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
--实战用例: | |
path-to-oracle-client\BIN\sqlldr userid=用户名/密码@tns名 control=控制文件.ctl direct=y parallel=y readsize=10005008 errors=999999999 | |
--控制文件.ctl内容: | |
load data | |
CHARACTERSET 'UTF8' | |
infile "webdata20180724_wh.txt" | |
Append into table xw_tmp_to_liuling_20180725 | |
fields terminated by "," |
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
EXECUTE 'UPDATE tbl SET ' | |
|| quote_ident(colname) -- | |
|| ' = ' | |
|| quote_nullable(newvalue) | |
|| ' WHERE key = ' | |
|| quote_literal(keyvalue); | |
EXECUTE format('UPDATE tbl SET %I = %L ' | |
'WHERE key = %L', colname, newvalue, keyvalue); | |
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
String supplant(String o,map) { | |
RegExp r = RegExp(r"{([^{}]+)}"); | |
return o.replaceAllMapped(r,(match){ | |
//print('matched;${match.group(1)}'); | |
return '${map[match.group(1)]}'; | |
}); | |
} | |
main(){ | |
print(supplant('hello,{person},i will {do} u',{'person':'julie','do':['love','then','touch']})); | |
} |
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
String deversion(String version){ | |
if(version == null || version.compareTo("1.0.0")<0) return version; | |
var versions = version.split('.'); | |
var s = int.parse(versions.first) -1; | |
versions[0] = s.toString(); | |
return versions.join('.'); | |
} | |
int versionValue(String version){ | |
if(version == null) return null; | |
var versions = version.split('.'); |
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"> | |
<title>JS Bin</title> | |
<script src=https://unpkg.com/@reactivex/[email protected]/dist/global/rxjs.umd.js></script> | |
</head> | |
<body> |
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
main() { | |
var p2 = '/Images/png/yw_icon.png'; | |
var p3 = 'Images/png/yw_icon.png'; | |
var rs = [ | |
'http://61.183.0.23/gzzs/appstore.aspx?d=18', | |
'https://13.cn.123/root/', | |
'https://13.cn.123/api', | |
'ftp://123.23.132/', | |
'wx://123/23', | |
p2, |
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
import 'dart:async'; | |
main() { | |
Future.value(10).then((_) { | |
Future(() => throw 'err').catchError((_){ | |
print('innner $_'); | |
throw 'no catch'; | |
}); | |
return _; | |
}).then((_) { |
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
# WSL2 network port forwarding script v1 | |
# for enable script, 'Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser' in Powershell, | |
# for delete exist rules and ports use 'delete' as parameter, for show ports use 'list' as parameter. | |
# written by Daehyuk Ahn, Aug-1-2020 | |
# Display all portproxy information | |
If ($Args[0] -eq "list") { | |
netsh interface portproxy show v4tov4; | |
exit; | |
} |
OlderNewer