Skip to content

Instantly share code, notes, and snippets.

<html><head><title>Javascript try..catch statement test code</title>
<script type="text/javascript">
output = null;
window.onload = function() {
output = document.getElementById('output');
log('loaded');
}
function log(msg) {
# AppController.rb
# test
require 'osx/cocoa'
OSX.ns_import :MyObject
class AppController < OSX::NSObject
include OSX
def initialize
@tester = MyObject.alloc.init;
/*
XPath utility
usage: var results= x$('//div');
x$('//div').each(function() {
...
});
*/
function $x(exp, obj) {
var target = obj || document;
/*
Create tag element
*/
function tag(name, attrs) {
var ele = document.createElement(name);
for(var i in attrs) {
ele[i] = attrs[i];
}
return ele;
@snaka
snaka / gyzowinR.rb
Created November 6, 2008 16:25
Gyazo client for windows (Ruby script version)
rem gyazowinR.bat
rem Gyazo client for Windows (Ruby script version)
rem by snaka (http://d.hatena.ne.jp/snaka72/)
ruby -x %~f0 %~s1
rem pause
exit
#! ruby
require 'net/http'
@snaka
snaka / readme.txt
Created November 17, 2008 11:50
Ganttproject2.0,7 patch for mouse wheel behavior
Index: D:/MyProject/GanttProject/ganttproject/src/net/sourceforge/ganttproject/ChartComponentBase.java
===================================================================
--- D:/MyProject/GanttProject/ganttproject/src/net/sourceforge/ganttproject/ChartComponentBase.java (revision 118)
+++ D:/MyProject/GanttProject/ganttproject/src/net/sourceforge/ganttproject/ChartComponentBase.java (working copy)
@@ -290,7 +290,14 @@
protected class MouseWheelListenerBase implements MouseWheelListener {
public void mouseWheelMoved(MouseWheelEvent e) {
- if (isRotationUp(e)) {
+ // Scroll
@snaka
snaka / gist:27133
Created November 20, 2008 18:32
export sequence from Oracle
set linesize 200
set pagesize 0
set trimspool on
set heading off
set feedback off
spool /tmp/impSeq.sql
select '-- delete sequence' from dual;
select 'DROP SEQUENCE ' || SEQUENCE_NAME || ';' from USER_SEQUENCES;
select '-- create sequence' from dual;
select 'CREATE SEQUENCE ' || SEQUENCE_NAME ||
' Growl for windows test script(VBA)
Sub growling()
Dim growler As Vortex_Growl_Framework.Growl
Set growler = New Growl
growler.ApplicationName = "Test VBA Script"
Dim notify As New Vortex_Growl_Framework.NotificationType
notify.Enabled = True
notify.Name = "testNotify"
alert("This is gist");
@snaka
snaka / hatena_c_url_to_title.user.js
Created December 6, 2008 09:31
はてなカウンターのURLの表示をタイトルに置き換えるGreaseMonkey
// ==UserScript==
// @name hatena_c_uri_to_title.user.js
// @namespace http://d.hatena.ne.jp/snaka72/
// @include http://counter.hatena.ne.jp/*target=url*
// @require https://gist.github.com/raw/3238/0b1c093e30415be1109f9a36664ebd56e0e7300b/dollarX.js
// ==/UserScript==
(function() {
var links = $X('//td[@class="maincell"]/a');
(function getTitle(links) {