Skip to content

Instantly share code, notes, and snippets.

@honda0510
honda0510 / Class1.cls
Created August 26, 2012 05:25
Publicなオブジェクト変数が破棄されるタイミング
' クラスモジュール: Class1
Option Explicit
Public Name As String
Private Sub Class_Terminate()
Debug.Print "Class_Terminate: " & Name
End Sub
@honda0510
honda0510 / CWeakReference.cls
Created August 26, 2012 05:18
弱参照を使ってオブジェクトの存在確認をしたい(未完)
' クラスモジュール: CWeakReference
Option Explicit
Private Declare Sub MoveMemory Lib "Kernel32" Alias "RtlMoveMemory" _
(Destination As Any, Source As Any, ByVal Length As Long)
Private m_vptr As Long
Public Sub SetTarget(target As Object)
@honda0510
honda0510 / gist:3329491
Created August 12, 2012 03:42
「2つのブックを比較し、変更個所を表示させたい http://www.moug.net/faq/viewtopic.php?t=64023」への回答
Option Explicit
Sub test()
Const TOOL_NAME As String = "変更点チェックツール"
Const CONFIRM_MASSEGE As String = _
"変更前と変更後のファイルを開いていたら閉じてください。" & vbLf & "中断しますか?"
Dim Result As VbMsgBoxResult
Dim TargetCellAddress As String
Dim BeforeBookPath As Variant
Dim AfterBookPath As Variant
@honda0510
honda0510 / gist:3088353
Created July 11, 2012 06:21
条件付き書式で設定した色を取得する http://www.moug.net/faq/viewtopic.php?t=63769
Option Explicit
' README
' 条件付き書式で設定した色を取得する
' http://www.moug.net/faq/viewtopic.php?t=63769
'
' これ用に書いてみた
' 必要なモジュール
' クリップボードを操作する方法 | YU-TANG's MS-Access Discovery
@honda0510
honda0510 / jquery-ajax-queue_1.0.js
Created April 26, 2012 01:17
Ajax Queue Plugin
/**
* Ajax Queue Plugin
*
* Homepage: http://jquery.com/plugins/project/ajaxqueue
* Documentation: http://docs.jquery.com/AjaxQueue
*/
/**
<script>
@honda0510
honda0510 / filter.php
Created April 24, 2012 01:50
【PHP】値をフィルタリングして数字だけにする
<?php
$values = array_filter((array)$values, create_function('$v', 'return is_int($v) || ctype_digit($v);'));
@honda0510
honda0510 / array.tpl
Created April 24, 2012 01:44
Smartyで配列を作る方法
{assign var=keys value=','|explode:'coffee,tea'}
{assign var=values value=','|explode:'コーヒー,紅茶'}
{assign var=drinks value=$keys|@array_combine:$values}
@honda0510
honda0510 / CopyText.js
Created April 5, 2012 06:28
文字列をクリップボードにコピー
function CopyText(TextData) {
var form = new ActiveXObject('Forms.Form.1');
var textbox = form.Controls.Add('Forms.TextBox.1').Object;
textbox.MultiLine = true;
textbox.Text = TextData;
textbox.SelStart = 0;
textbox.SelLength = textbox.TextLength;
textbox.Copy();
}
@honda0510
honda0510 / DoNothing1.user.js
Created March 28, 2012 01:36
Greasemonkey Test2
// ==UserScript==
// @name DoNothing1
// @namespace honda0510
// @include http://www.moug.net/*
// @require https://gist.github.com/raw/2222729/IncludeMe.js
// ==/UserScript==
try {
GM_log(hoge);
} catch (e) {
@honda0510
honda0510 / DoNothing.user.js
Created March 28, 2012 01:27
Greasemonkey Test1
// ==UserScript==
// @name DoNothing
// @namespace honda0510
// @include *
// ==/UserScript==
// エラーコンソール(Ctrl + Shift + j)にロギング
GM_log('DoNothing run at ' + location.href);