Skip to content

Instantly share code, notes, and snippets.

View punkmonday's full-sized avatar

fff punkmonday

View GitHub Profile
@punkmonday
punkmonday / toggle.js
Created September 19, 2016 05:51
select all check box
function toggleCheckImage(source) {
checkboxes = document.getElementsByClassName("imagecheckbox");
for (var i = 0, n = checkboxes.length; i < n; i++) {
checkboxes[i].checked = source.checked;
}
}
@punkmonday
punkmonday / jcmd
Last active September 26, 2016 06:56
linux server jre jcmd
sudo /usr/lib/jdk1.8.0_92/bin/jcmd
JFR.stop
JFR.start
JFR.dump
JFR.check
VM.native_memory
VM.check_commercial_features
VM.unlock_commercial_features
ManagementAgent.stop
@punkmonday
punkmonday / change teamspeaker3 default_voice_port
Last active October 8, 2016 03:35
telnet change teamspeak default_voice_port
#use telnet connect teamspeakser query server
telnet ip 10011
#login query_server
login serveradmin yourpassword
serverstop sid=1
use sid=1 -virtual
serveredit virtualserver_port=9988
use sid=0
serverstart sid=1
@punkmonday
punkmonday / shadowsocks_website
Created October 9, 2016 05:27
shadowsocks_商家网站
https://shadowsocks.com/
http://www.ishadowsocks.org/
:e $MYVIMRC 打开vimrc,在windows平台会打开_vimrc
__init__.py里import的模块,实际运行的时候是在当前的目录(就是你目前所在的目录)寻找package,而不是__init__.py所在目录,所以就会导致找不到模块
所以要真正能导入,需要
import sys
sys.path.append("__init__.py所在目录")
之后
import 的模块就会到append的路径里查找模块了
@punkmonday
punkmonday / .npmrc
Last active December 12, 2016 07:21
Scripts
registry=https://registry.npm.taobao.org
prefix=C:/Users/w4u/.npm-packages
@punkmonday
punkmonday / MyFaceletViewHandler.java
Created February 13, 2017 08:14
MyFaceletViewHandler.java
public class MyFaceletViewHandler extends FaceletViewHandler {
public MyFaceletViewHandler(ViewHandler parent) {
super(parent);
}
@Override
public UIViewRoot restoreView(FacesContext facesContext, String viewId) {
UIViewRoot root = super.restoreView(facesContext, viewId);
// do not allow ViewExpiredException
@punkmonday
punkmonday / Aui_centerAndShowDialog.js
Last active February 17, 2017 06:03
centerAndShowDialog.js
function centerAndShowDialog(dialog) {
var c = Liferay.component(dialog);
//dialog show 之前设置一个固定高度,为了窗口居中
AUI().Do.before(function () {
c.set("centered", true);
c.set("height", "70%");
}, c, "show");
//dialog show 之后,把高度设置为auto
AUI().Do.after(function () {
console.log("after");
@punkmonday
punkmonday / autobackup.sh
Created March 15, 2017 09:13
How to Automate Backups for JIRA Cloud applications
#!/bin/bash
USERNAME=youruser
PASSWORD=yourpassword
INSTANCE=example.atlassian.net
LOCATION=/where/to/store/the/file
# Set this to your Atlassian instance's timezone.
# See this for a list of possible values:
# https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
TIMEZONE=America/Los_Angeles