Skip to content

Instantly share code, notes, and snippets.

@fengxx
fengxx / ocrobot.au3
Created November 6, 2012 02:58
Office communicator/Lync auto reply
#include <IE.au3>
#include <File.au3>
Dim $IMClassName="[CLASS:IMWindowClass]"
Dim $myLog="c:\temp\ocrobot.log"
Dim $oSp = ObjCreate("SAPI.SpVoice")
Func MyExit()
Exit 0
EndFunc
@fengxx
fengxx / bookcontent.js
Created October 31, 2012 06:58
hide books24x7 useless header
if (location.href.indexOf('skillport.books24x7.com/assetviewer.aspx?') != -1 )
{
window.addEventListener(
'load',
function showDirectURI() {
//hide useless header so book contents will be larger
document.getElementById("HeaderTable").style.display="none";
document.getElementById("container").style.height="100%";
}
,false
@fengxx
fengxx / websvr.js
Created October 18, 2012 07:14
simple web server to host static content
var express = require('express');
var app = express();
app.use(express.logger())
app.use(express.static(__dirname + '/public'));
app.use(express.bodyParser());
var port = process.env.PORT || 5000;
app.post('/testpost', function(req, res) {
res.send(JSON.stringify(req.body));
@fengxx
fengxx / sample.html
Created October 18, 2012 07:13
simple form
<html>
<form id="form1" action="/testpost" method="post">
<table>
<tr>
<td>
<label for="username">Name: </label>
</td>
<td>
<input type="text" id="username" name="username"></input>
</td>
@fengxx
fengxx / raysource.js
Created October 2, 2012 11:21
simplfy rayfile download
//author fengxx
var downloadLinkOK=false
var redirectOk=false
if (location.href.indexOf('www.rayfile.com/zh-cn/files/')!=-1 )
{
function redirectme(userJSEvent){
if(typeof vid !="undefined" && typeof vkey !="undefined" && !redirectOk){
redirectOk=true
var nextUrl="http://www.rayfile.com/zh-cn/files/"
@fengxx
fengxx / example.sh
Created August 22, 2012 11:59
run script and cp stdin and stdout
echo x - ScriptRunner.java
cat >ScriptRunner.java <<'!Funky!Stuff!'
import java.io.*;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
*
* @author Ted
@fengxx
fengxx / resize_pic.au3
Created September 27, 2011 07:21
jpeg resize
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <StaticConstants.au3>
#include <GDIPlus.au3>
#include <File.au3>
#include <Array.au3>
; Creating GUI and controls GUICreate ( "title" [, width [, height [, left [, top [, style [, exStyle [, parent]]]]]]] )
$hGui = GUICreate("Resize JPEG", 320, 130, @DesktopWidth / 2 - 192, _
@DesktopHeight / 2 - 235, -1, $WS_EX_ACCEPTFILES)