Skip to content

Instantly share code, notes, and snippets.

var myVar = setInterval(function(){ window.scrollBy(0, 300) }, 800);
clearTimeout(myVar);
/*************************************************************************
* *
* EJBCA: The OpenSource Certificate Authority *
* *
* This software is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or any later version. *
* *
* See terms of license at gnu.org. *
package cn.liveworks.dev.util;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
/**
* must have this config
* <bean id="auth_contextApplicationContextProvider"
* class="com.wangyin.ssoclient.sso.util.ApplicationContextProvider">
@zxlooong
zxlooong / comparever.js
Created September 23, 2014 12:42
javascript 相关
function comparever(var1, var2){
var iret = 0;
var var1splitlist = var1.split(".");
//var ver1splitlen = ver1split.length;
var var2splitlist = var2.split(".");
var comparelen = var1splitlist.length > var2splitlist.length ? var1splitlist.length : var2splitlist.length;
for(var n=0; n<comparelen; n++){
@zxlooong
zxlooong / IsAdministrator.cpp
Created September 23, 2014 07:10
windows 相关操作
BOOL CWyPassEdit::IsAdministrator()
{
//判断是否管理员模式
BOOL bIsElevated = FALSE;
HANDLE hToken = NULL;
UINT16 uWinVer = LOWORD(GetVersion());
uWinVer = MAKEWORD(HIBYTE(uWinVer),LOBYTE(uWinVer));
@zxlooong
zxlooong / IDispatchInvoke.cpp
Last active August 29, 2015 14:05
com调用相关
void IDispatchInvoke()
{
// TODO: Add your implementation code here
::CoInitialize(NULL); // COM 初始化
CLSID clsid; // 通过 ProgID 得到 CLSID
HRESULT hr = ::CLSIDFromProgID(L"Ctrl.1", &clsid);
//ASSERT(SUCCEEDED(hr)); // 如果失败,说明没有注册组件
@zxlooong
zxlooong / AddBCProvider.java
Created March 26, 2014 08:54
bouncy castle
static {
if (Security.getProvider("BC") == null) {
Security.addProvider(new BouncyCastleProvider());
}
}
System.out.println(new BigInteger(16 * 8, new Random()).toString(16));
@zxlooong
zxlooong / repo.py
Created June 16, 2013 15:07
repo.py
#!/usr/bin/env python
## repo default configuration
##
from __future__ import print_function
REPO_URL = 'https://gerrit.googlesource.com/git-repo'
REPO_REV = 'stable'
# Copyright (C) 2008 Google Inc.
#
@zxlooong
zxlooong / readInnerZipFile.java
Last active December 18, 2015 12:59
readInnerZipFile.java
public static boolean readInnerZipFile(String oriZipFile,String
innerZipFileEntryName, String outZipFileEntryName) {
ZipFile innerZipFile = null;
try {
innerZipFile = new ZipFile(oriZipFile);
Enumeration entries = innerZipFile.entries();
ZipEntry entryIn = null;
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
// System.out.println(entry);