Skip to content

Instantly share code, notes, and snippets.

View 某DBの日付書式をエクセル用に変換
#!/usr/bin/ruby
require 'parsedate'
f = open("target.txt")
f.each{ |line|
day = ParseDate::parsedate(line)
year = day[0].to_s
month = day[1].to_s
View buzzwdkiller.js
// ==UserScript==
// @name s/cloud/online/g
// @namespace http://somethingnew2.com/js/monkeys/
// @description buzz word killer.
// @author SATO Yozo
// @version 0.1
// ==/UserScript==
(function() {
var suffix = 'オンライン';
View simple swfmill sample
<?xml version="1.0" encoding="utf-8" ?>
<movie width="240" height="320" framerate="12">
<background color="#000000" />
<frame>
<library>
<clip id="foo" import="library/foo.jpg"/>
</library>
<place id="foo" name="foo" depth="1" width="100%" height="100%" x="10"/>
</frame>
@yoozoosato
yoozoosato / roger.yasnippet
Created Jan 24, 2011
mewでメール読み書きする用
View roger.yasnippet
# -*- mode: snippet -*-
# name: roger
# --
お疲れ様です。佐藤です。
下記、了解しました。
@yoozoosato
yoozoosato / batteryInfo.sh
Created Sep 7, 2011
Get MacBook battery info for 'bucktick'
View batteryInfo.sh
#!/bin/sh
/usr/bin/pmset -g ps | tail -n 1 | awk '{print $2", " $4" remains"}' | sed 's/;//';
@yoozoosato
yoozoosato / AccessToken.rb
Created Oct 6, 2011
Get access token via facebook oauth. API key and API secret are saved with Config::Pit.
View AccessToken.rb
# -*- coding: utf-8 -*-
require 'rubygems'
require 'net/https'
require 'pit'
OAUTH_DOMAIN = 'graph.facebook.com' # ホスト名
OAUTH_PATH = '/oauth/access_token' # パス
OAUTH_QUERY_APIKEY = 'client_id' # API Keyのクエリパラメータ
OAUTH_QUERY_APISEC = 'client_secret' # API secret のクエリパラメータ
OAUTH_QUERY_TYPE = 'grant_type=client_credentials' # 固定
@yoozoosato
yoozoosato / z2h
Created Jan 11, 2012
全角英数字記号を半角英数字記号に変換するグリモンスクリプト
View z2h
// ==UserScript==
// @name z2h
// @namespace http://somethingnew2.com/js/monkeys/
// @description 全角英数字を半角に変換するよ
// @author SATO Yozo
// @version 0.1
// ==/UserScript==
(function() {
var z = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@-.,:';
@yoozoosato
yoozoosato / rails_new.log
Created Feb 3, 2012
Rails 3.2.1 segmentation fault
View rails_new.log
% rails new myapp --skip-test-unit
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/images/rails.png
create app/assets/javascripts/application.js
@yoozoosato
yoozoosato / text-scale-change
Created Aug 27, 2012
for code review, report etc., with projecter
View text-scale-change
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; text-size
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(global-set-key (kbd "M-S-<down>") 'text-scale-decrease)
(global-set-key (kbd "M-S-<up>") 'text-scale-increase)
View boyfriend.rb
# -*- coding: utf-8 -*-
class Boyfriend
# 1.たばこを吸わない人(必須)
def smoke?
return false
end
# 2.アルコールを飲んでも性格が変わらない人(必須)
def drink(alchol)