Skip to content

Instantly share code, notes, and snippets.

@yu-tang
yu-tang / gist:953997
Created May 3, 2011 19:13
ADODB のインメモリ レコードセットを Access 非連結フォームのレコードソースにセットする
' ADODB のインメモリ レコードセットを Access 非連結フォームのレコードソースに
' セットするサンプル コード。
' 下記をコピペでテストする場合は、運送会社テーブルから表形式フォームをオート
' フォームで作成して、フォームのレコードソース プロパティを削除すると多少楽。
Option Compare Database
Option Explicit
Private Sub Form_Load()
' インメモリ レコードセットをフォームのレコードソースにセットします。
@yu-tang
yu-tang / vanillaforums-ja_Garden
Created June 21, 2011 08:47
vanillaforums-ja の Garden リポジトリ作成手順
vanillaforums-ja の Garden リポジトリ作成手順
===============
以下、基本的には Windows 版の Git Bash 上での操作を前提とします。
`git push` の対象を現在のブランチのみに限定するため、以下の設定を行っておくことを推奨します。
git config --global push.default tracking
参考:[見えないチカラ: 【翻訳】あなたの知らないGit Tips](http://keijinsonyaban.blogspot.com/2010/11/git-tips.html "見えないチカラ: 【翻訳】あなたの知らないGit Tips")
@yu-tang
yu-tang / gist:1145107
Created August 14, 2011 17:39
Vanilla のプリティ URL をサブディレクトリで有効にする手順
1. conf/config.php
$Configuration['Garden']['RewriteUrls'] = FALSE;
$Configuration['Garden']['RewriteUrls'] = TRUE;
2. .htaccess
こんな感じになってるところを、
# RewriteEngine On
# Certain hosts may require the following line.
# If vanilla is in a subfolder then you need to specify it after the /.
@yu-tang
yu-tang / gist:1145122
Created August 14, 2011 17:49
Vanilla のコンフィグ ファイルを編集可能にする
パーミッションが775になるので、FTP で上書きできない。
原因。
/library/core/class.configuration.php
L559 chmod($TmpFile, 0775);
なので、0706 とか 0756 あたりに変えておく。
こういう設定値こそコンフィグでカスタマイズできるようにしておいてほしい感じだけれど。
@yu-tang
yu-tang / ThisWorkbook.cls
Created November 14, 2011 08:42
ScriptControl 経由で JScript から Win API を利用する
' クラスモジュール限定。Excel なら、とりあえず ThisWorkbook モジュールあたりで。
Option Explicit
Private Declare Function StrCmpLogicalW Lib "SHLWAPI.DLL" ( _
ByVal lpStr1 As Long, _
ByVal lpStr2 As Long) As Long
Public Function StrCmpLogical(str1 As String, str2 As String) As Long
StrCmpLogical = StrCmpLogicalW(StrPtr(str1), StrPtr(str2))
End Function
@yu-tang
yu-tang / gist:1380055
Created November 20, 2011 09:21
引数を取らない JScript の関数オブジェクトを実行する方法が分からない
Option Explicit
' 引数を取らない JScript の関数オブジェクトを実行する方法が分からない
Sub Test()
Dim sc As New MSScriptControl.ScriptControl
Dim fx As Object
Dim s As String
s = "eval(function(){return x;});"
@yu-tang
yu-tang / CIE.cls
Created January 16, 2012 07:51
IEのロード待機サンプル(VBAのイベント駆動版)
' 要・Microsoft Internet Controls 参照設定
Option Explicit
Private WithEvents ie As InternetExplorer
Private mDocumentComplete As Boolean
Private Sub Class_Initialize()
Set ie = New InternetExplorer
ie.Visible = True
Navigate "about:blank"
@yu-tang
yu-tang / include.js
Created January 26, 2012 10:42
CScript/WScript 環境の JScript 用ユーティリティ
/*
いちいち WScript... と書きたくないためだけのユーティリティ
*/
// echo() as WScript.Echo()
this.echo = function(){
var s = '',i, numargs = arguments.length;
for (i = 0; i < numargs; i++){
s += arguments[i];
}
@yu-tang
yu-tang / gprops.js
Created January 27, 2012 16:59
CScript/WScript 環境の JScript.Global オブジェクトに既定で追加されているプロパティを調べてみる
/*
CScript/WScript 環境の JScript.Global オブジェクトに
既定で追加されているプロパティを調べてみる
*/
(function(obj){
var a = [];
for (var i in obj) {
a.push(i + ':' + typeof(obj[i]));
}
WScript.Echo(a.join('\n'));
@yu-tang
yu-tang / classof.js
Created January 27, 2012 18:11
CScript/WScript 環境の JScript 用クラス名取得関数 classof()
/*
CScript/WScript 環境の JScript 用クラス名取得関数 classof()
JScript では constructor.name が使えないので、下記をベースに改良。
Magnetiq - Finding Out Class Names of JavaScript Objects
http://blog.magnetiq.com/post/514962277/finding-out-class-names-of-javascript-objects
何となくそれらしい文字列が取れていれば良いことにしておく。
*/