Skip to content

Instantly share code, notes, and snippets.

justpsvm

Block or report user

Report or block justpsvm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@justpsvm
justpsvm / webvr.js
Created May 22, 2018
解密后的 krpano webvr.js
View webvr.js
var krpanoplugin = function () {
function vs(e) {
return ".yes.on.true.1" [a](("." + e)[m]()) >= 0
}
function gs() {
ns = 0;
if (oi[nr] || Ei) ns = 2;
if (ns > 0) {
if (ji == 1 && oi[M] && oi[Bn] && (oi[I] | 0) == 65) {
var e = r,
@justpsvm
justpsvm / krpano.js
Created May 22, 2018
解密后的 krpano.js 版本号: krpano-1.19-pr15
View krpano.js
/*
krpano Embedding Script
krpano 1.19-pr4 (build 2016-04-07)
*/
function createPanoViewer(e) {
function ut(e) {
return ("" + e).toLowerCase()
}
function at(e, t) {
View lombok.pom
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.6</version>
</dependency>
@justpsvm
justpsvm / tool.js
Last active Dec 9, 2017
[js 中常用的扩展方法] #js
View tool.js
//添加数组的移除函数
Array.prototype.remove = function(from, to) {
var rest = this.slice((to || from) + 1 || this.length);
this.length = from < 0 ? this.length + from : from;
return this.push.apply(this, rest);
};
//添加 indexOf 函数功能
Array.prototype.indexOf = function(val,name) {
for (var i = 0; i < this.length; i++) {
@justpsvm
justpsvm / snippet.java
Created Nov 28, 2017
[Java 获取运行中的线程] #java #线程
View snippet.java
ThreadGroup group = Thread.currentThread().getThreadGroup();
ThreadGroup topGroup = group;
// 遍历线程组树,获取根线程组
while (group != null) {
topGroup = group;
group = group.getParent();
}
// 激活的线程数再加一倍,防止枚举时有可能刚好有动态线程生成
int slackSize = topGroup.activeCount() * 2;
Thread[] slackThreads = new Thread[slackSize];
@justpsvm
justpsvm / snippet.java
Created Sep 6, 2017
[Java 获取今年第一天和最后一天] #java #日期处理
View snippet.java
public static String getYearBegin(){
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.MONTH,calendar.getMinimum(Calendar.MONTH));
calendar.set(Calendar.DAY_OF_MONTH,calendar.getMinimum(Calendar.DAY_OF_MONTH));
return DateUtils.getDateStrByFormat(calendar.getTime(),"yyyy-MM-dd");
}
public static String getYearEnd(){
@justpsvm
justpsvm / jquery.pjax.2.js
Last active Aug 29, 2017
[pjax jquery 3.0 修复版本] 针对 jquery3.0 的修复版本 不会报 push 错误 #js
View jquery.pjax.2.js
/*!
* pjax(ajax + history.pushState) for jquery
*
* by welefen
*/
(function($) {
var Util = {
support : {
pjax : window.history && window.history.pushState && window.history.replaceState && !navigator.userAgent.match(/(iPod|iPhone|iPad|WebApps\/.+CFNetwork)/),
storage : !!window.localStorage
@justpsvm
justpsvm / replaceAll.js
Created Aug 25, 2017
[js replaceAll 实现] #js
View replaceAll.js
String.prototype.replaceAll = function(search, replacement) {
var target = this;
return target.replace(new RegExp(search, 'g'), replacement);
};
@justpsvm
justpsvm / sh-thread-kill.sh
Created Aug 9, 2017
[脚本查找端口并关闭进程] shell 脚本实现 #sh
View sh-thread-kill.sh
#!/bin/sh
if [ $(lsof -t -i:6000) ]; then
echo 'stop'
kill -9 $(lsof -t -i:6000) fi
@justpsvm
justpsvm / formdata.js
Last active Nov 21, 2017
[FormData 异步上传] 异步上传 #jquery
View formdata.js
var formData = new FormData(excelForm[0]);
$.ajax({
url: 'upload.jhtml',
type: 'POST',
cache: false,
data: formData,
processData: false,
contentType: false
})
You can’t perform that action at this time.