This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* <script data-stork-product-id="1234"> | |
(function() { | |
//jsの読み込みコード | |
})(); | |
</script> */ | |
function getProductId() { | |
var scripts = document.getElementsByTagName('script'); | |
var id; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Stork = Stork || {}; | |
Stork.$ = Stork.jQuery = jQuery.noConflict(true); // noconflictを使うことで外のバージョンと切り分けてjQueryをロードできる |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- HTML5対応しているブラウザならこれで良い。IEは10以降 --> | |
<script async src="http://somedomain.com/widget.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
## How To Use | |
# | |
# $ ./extract_colors_from_css.rb style.css > out.html | |
# $ open out.html | |
# | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Buffalo WAPM-APG300N / WAPM-AG300Nの設定を自動化するスクリプト | |
# sshでルーターに接続し、 コマンドを実行する。 | |
# | |
require 'net/ssh' | |
host = ARGV[0] # ホスト名 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
class Classifier | |
def initialize(get_features) | |
@feature_count = Hash.new {|h, k| h[k] = Hash.new {|h1, k1| h1[k1] = 0}} | |
@category_count = Hash.new {|h, k| h[k] = 0} | |
@get_features = get_features | |
end | |
def inc_feature_count(feature, category) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# conding: utf-8 | |
# | |
# this script shows pid which contains 'some_process' | |
# | |
require 'pty' | |
require 'expect' | |
cmd = 'ssh username@somehost' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# conding: utf-8 | |
# | |
# this script shows pid which contains 'ruby' | |
# | |
require 'pty' | |
cmd = 'ps aux | grep ruby' | |
PTY.spawn(cmd) do |reader, writer, pid| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
//papa crock's code | |
if (typeof Object.create !== 'function') { | |
Object.create = function(o) { | |
var F = function(){}; | |
F.prototype = o; | |
return new F(); | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="jquery.js"></script> | |
<script type="text/javascript" src="jquery.rightClick.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
var zoom_ratio = 1; | |
$('#content').offset({top: $('#view_window').width() / 2, left: $('#view_window').height() / 2}); |
NewerOlder