Instantly share code, notes, and snippets.

View hp.js
$("html,body").click(function(e) {
var gcd = new Array("富强", "民主", "文明", "和谐", "自由", "平等", "公正", "法治", "爱国", "敬业", "诚信", "友善");
var n = Math.floor(Math.random() * gcd.length);
var $i = $("<b/>").text(gcd[n]);
var x = e.pageX,
y = e.pageY;
$i.css({
"z-index": 99999,
"top": y - 20,
"left": x,
View win10.bat
@echo off
pushd "%~dp0"
dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txt
dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~3*.mum >>List.txt
for /f %%i in ('findstr /i . List.txt 2^>nul') do dism /online /norestart /add-package:"C:\Windows\servicing\Packages\%%i"
pause
View oracle.sql
declare
i int;
now date;
date1 date;
week int;
begin
now := trunc(sysdate);
for i in 0..2000 loop
date1 := now + i;
week := to_number(to_char(date1 - 1, 'd'));
View bj_v1.js
/**
* CODETANK
* Copyright (c) 2012, Tencent AlloyTeam, All rights reserved.
* http://CodeTank.AlloyTeam.com/
*
* @version 1.0
* @author AlloyTeam
*
* .d8888b. 888 88888888888 888 TM
* d88P Y88b 888 ''''888'''' 888
View UpdateMp3Name.java
package net.binjoo;
import java.io.File;
public class UpdateMp3Name {
public static void main(String[] args) {
String oldPath = "E:\\BaiduMusic\\Songs";
File file = new File(oldPath);
File[] files = file.listFiles();
View Amount2RMB.java
/*
* Amount2RMB.java 2008-6-15
*/
package test;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Amount2RMB {
private static final Pattern AMOUNT_PATTERN =
View default.java
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class HTMLSpirit{
public static String delHTMLTag(String htmlStr){
String regEx_script="<script[^>]*?>[\\s\\S]*?<\\/script>"; //定义script的正则表达式
String regEx_style="<style[^>]*?>[\\s\\S]*?<\\/style>"; //定义style的正则表达式
String regEx_html="<[^>]+>"; //定义HTML标签的正则表达式
Pattern p_script=Pattern.compile(regEx_script,Pattern.CASE_INSENSITIVE);
View default.php
/**
* 生成随机字符串
*
* @access public
* @param integer $length 字符串长度
* @param string $specialChars 是否有特殊字符
* @return string
*/
public static function randString($length, $specialChars = false) {
$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
View open-document.reg
Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Sublime Text 2]
[-HKEY_CLASSES_ROOT\*\shell\Sublime Text 2]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Sublime Text 2]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Sublime Text 2\command]
@="D:\\微云网盘\\105871875\\Soft\\SublimeText2\\sublime_text.exe \"%1\""
View WechatCallbackApi.java
package net.binjoo.wechat;
import java.io.IOException;
import java.util.Arrays;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;