Skip to content

Instantly share code, notes, and snippets.

View hidsh's full-sized avatar

yakshaver hidsh

View GitHub Profile
' usage: start-app \path\to\foo.exe
'
Set args = WScript.Arguments
directory = get_directory(args(0))
exe_name = get_filename(args(0))
params = ""
'
@hidsh
hidsh / gist:1422759
Created December 2, 2011 10:41
xyzzy: open command prompt using ckw "M-x c"
(defun c ()
(interactive)
(let ((cmd "C:\\Users\\g\\Dropbox\\apps\\ckw-mod-0.9.0-d2\\ckw-mod-0.9.0-d2\\ckw.exe")
(path (get-buffer-file-name))
(opt ""))
(when path
(setq opt (concat " -cd \"" (directory-namestring path) "\"")))
(call-process (concat cmd opt) :wait nil)))
@hidsh
hidsh / gist:1422829
Created December 2, 2011 11:11
wsh: argument test
'wsh argument test
For Each p in WScript.Arguments
wscript.echo p
Next
@hidsh
hidsh / gist:1424949
Created December 2, 2011 21:40
wsh: argument test 2
'wsh argument test
If WScript.Arguments.Count > 0 then
wscript.echo WScript.Arguments(0)
End If
@hidsh
hidsh / dvd_iso_play.vbs
Created December 2, 2011 22:56
media player classic で .iso を再生する wsh スクリプト
' play dvd iso
'
' 1. mount iso (using WinCDEmu)
' 2. launch mpc and play
' 3. unmount iso
'
MOUNTER="""C:\Program Files (x86)\WinCDEmu\batchmnt64.exe"""
DVD_DRV="v:"
PLAYER="C:\Users\g\Dropbox\apps\MPC-HomeCinema.1.5.2.3456.x64\mpc-hc64.exe"
@hidsh
hidsh / gist:1436542
Created December 6, 2011 03:16
python: 変数の値をメンバ名として追加する
s = '^\\s*%s\\s*:\\s*(.+).*'
fields = ['vara', 'varb', 'varc', 'vard']
conf = t_config()
for ln in lines:
for f in fields:
m = re.match(s % f, ln, re.IGNORECASE)
if m:
conf.__dict__[f] = m.group(1) # e.g. conf.vara = '100'
import sys
Morpheous = "You take the blue pill and the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill, you stay in Wonderland, and I show you how deep the rabbit hole goes."
def which_do_you_choose(your_mind):
return 'red pill' if your_mind == 'believe' else 'blue pill'
def enter_the_matrix():
while True:
for c in Morpheous:
@hidsh
hidsh / gist:1445786
Created December 8, 2011 02:16
python: re.finditer sample
import re
s = """xxxxx
Hello spam!
Hello Python!
yyyyy"""
match = re.search(r'^Hello (.*)$', s, re.MULTILINE)
for m in re.finditer(r'^Hello (.*)$', s, re.MULTILINE):
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
@hidsh
hidsh / xyzzy.ini
Created December 12, 2011 08:07
util/xyzzy/usr/<user-name>/wxp/xyzzy.ini
[Font]
Ascii=19,"Consolas",0
Japanese=19,"MeiryoKe_Gothic",128
Latin=17,"Courier New",0
Cyrillic=17,"Courier New",0
Greek=17,"Courier New",0
GB2312=17,"MS Hei",0
BIG5=18,"MingLiu",0
KSC5601=18,"GulimChe",0
Georgian=17,"BPG Courier New U",0