Skip to content

Instantly share code, notes, and snippets.

require 'win32ole'
context = WIN32OLE.new('SAPI.SpSharedRecoContext.1')
#context = WIN32OLE.new('SAPI.SpInProcRecoContext.1')
grammar = context.CreateGrammar(1)
grammar.DictationLoad()
grammar.DictationSetState(1)
event = WIN32OLE_EVENT.new(context, "_ISpeechRecoContextEvents")
// for tombloo 0.3.13
models.register(
{
name : 'Howm',
ICON : 'chrome://tombloo/skin/local.ico',
check : function(ps) {
switch (ps.type) {
case 'regular':
case 'quote':
case 'link':
@llatzhar
llatzhar / active_process.rb
Created September 16, 2008 07:59
record active process
require 'Win32API'
require 'kconv'
$KCODE = 's'
# user32.dll
$GetForegroundWindow = Win32API.new("user32", "GetForegroundWindow", '', 'L')
$GetWindowText = Win32API.new("user32", "GetWindowText", 'LPI', 'I')
$GetWindowThreadProcessId = Win32API.new("user32", "GetWindowThreadProcessId", 'LP', 'L')
@llatzhar
llatzhar / gist:33287
Created December 8, 2008 00:24
rakefile for delphi
require 'rake/clean'
def win_sh(cmd)
`#{cmd}`.each do |l|
/\((\d*)\)/ =~ l.gsub!('
','')
if $& == nil
puts l
else
puts "#{$`}:#{$1}:#{$'}"
<html>
<head>
<HTA:APPLICATION ID="hta"
SCROLL="no"/>
<script language="RubyScript">
def start
require 'rubygems'
require 'mechanize'
require 'nkf'
# 1 state 1 block
module Hsm
class Event
def initialize(name)
@name = name
end
end
# system events
INIT = Event.new('INIT')
@llatzhar
llatzhar / neutralize jamming for_firefox
Last active May 12, 2016 07:05
neutralize easterEgg jamming
javascript: !function(d,f,s){
s=d.createElement("script");
s.src="//j.mp/1bPoAXq";
s.onload=function(){f(jQuery.noConflict(1))};
d.body.appendChild(s)}(document,function($){
spans=$('strong span.fcs span');
for(i=0;i<spans.length;i++){$(spans[i]).remove();}
spans=$('strong span:not(.fcs)');
for(i=0;i<spans.length;i++){$(spans[i]).remove();}
spans=$('div.content span:not(.fcs)');
@llatzhar
llatzhar / dl.rb
Created July 12, 2018 06:16
dl.rb
70.times do |i|
`wget http://profile-cdn.xvideos.com/videos/profiles/galleries/cb/c7/0b/suzuyan/gal100012/pic_#{"%d" % (i+1)}_big.jpg`
end