Skip to content

Instantly share code, notes, and snippets.

@flying19880517
flying19880517 / 20110628_sina_XSS.js
Last active September 26, 2015 22:37
2011年6月28日新浪微博的XSS攻击代码 http://coolshell.cn/articles/4914.html
function createXHR(){
return window.XMLHttpRequest?
new XMLHttpRequest():
new ActiveXObject("Microsoft.XMLHTTP");
}
function getappkey(url){
xmlHttp = createXHR();
xmlHttp.open("GET",url,false);
xmlHttp.send();
result = xmlHttp.responseText;
@flying19880517
flying19880517 / rot13.js
Created August 25, 2011 02:32
ROT13加密
function rot13(s){
return s.replace(/[a-zA-Z]/g,function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);})
}
//document.write(rot13("Hello world"));
@flying19880517
flying19880517 / The Disappearance of Haruhi Suzumiya.htm
Created August 25, 2011 02:35
凉宫春日的消失 緊急逃離程式
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>緊急逃離程式</TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<style type="text/css">
body{margin:16px;font: 16px; background-color:#000; color:#fff}
<!DOCTYPE HTML>
<html>
<head>
<title>clock3D</title>
<style type="text/css" _mce_bogus="1">
<!--
html {
overflow: hidden;
}
@flying19880517
flying19880517 / WubiCodeIndex.cs
Created September 3, 2011 21:50
五笔编码索引转换
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WubiCodeIndex
{
class Program
{
//题目:
@flying19880517
flying19880517 / gist:1283154
Created October 13, 2011 02:01
使用更新锁自己处理自增主键
-- 测试表
CREATE TABLE dbo.tb(
id int PRIMARY KEY
)
INSERT dbo.tb(id)
SELECT 1 UNION ALL
SELECT 2 UNION ALL
SELECT 3
GO
@flying19880517
flying19880517 / password.py
Created December 21, 2011 14:29
加入了随机 Salt 的哈希算法
import os,binascii
from hashlib import sha256
from hmac import HMAC
def encrypt_password(password, salt=None):
"""Hash password on the fly.
先通过标准随机库生成 64 bits 的随机 salt,
使用了标准的 SHA-256 做为基本的 hash 算法,
使用标准 HMAC 算法作为 salt 混淆。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Threading;
using System.Runtime.InteropServices;
namespace SimpleConsole
{
<html><head>
<title>Flip</title>
<style type="text/css">
textarea { font-family: "Arial Unicode MS", Batang }
h1 { margin-bottom: 2px;}
</style>
<script>
function flip() {
var result = flipString(document.f.original.value.toLowerCase());
document.f.flipped.value = result;
@flying19880517
flying19880517 / aamaker.html
Created March 14, 2012 15:46
随机生成表情
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>お顔☆メーカー - あなただけの顔文字作ります</title>
</head>
<body style="text-align: center">
<form action="http://twitter.com/home">
<p id="target" style="height: 1.5em; font-size: 3em; font-family: 'Lucida Grande', sans-serif; color: pink">(*╹ლ╹) JavaScript を挿入してね♡
<p><input type="button" value="再生成" onclick="generate()">