Skip to content

Instantly share code, notes, and snippets.

View akm's full-sized avatar

Takeshi Akima akm

View GitHub Profile
@akm
akm / gemspec
Created November 13, 2010 15:08 — forked from defunkt/gemspec
#!/usr/bin/env ruby
# Usage: gemspec [-s] GEMNAME
#
# Prints a basic gemspec for GEMNAME based on your git-config info.
# If -s is passed, saves it as a GEMNAME.gemspec in the current
# directory. Otherwise prints to standard output.
#
# Once you check this gemspec into your project, releasing a new gem
# is dead simple:
#
#! /usr/bin/env ruby
require "optparse"
DEFAULT_OPTIONS = {
:layout => File.expand_path("./textile2html_layout.html.erb", File.dirname(__FILE__)),
:src_dir => File.expand_path("."),
:dest_dir => File.expand_path("."),
:noop => false,
:verbose => false,
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-script-type" content="text/javascript" />
</head>
<body>
<div style="float:right; font-size:x-small;max-width:40%;">
<%= yield(:page_outline) %>
@akm
akm / rails_template_base.rb
Created May 29, 2011 14:20
rails template
require 'fileutils'
FileUtils.cp("config/database.yml", "config/database.yml.example")
File.open(".gitignore", "a") do |f|
f.puts "Gemfile.lock"
f.puts ".rvmrc"
end
File.open("config/.gitignore", "a"){|f| f.puts("*.example")}
gem 'factory_girl_rails', :group => [:development, :test]
# -*- coding: utf-8 -*-
require "rubygems"
require "amqp" # requires version >= 0.8.0.RC14
puts "=> Example of automatic AMQP channel and queues recovery"
puts
AMQP.start(:host => "localhost") do |connection, open_ok|
puts "AMQP.start block runs"
# on_open, on_closedに渡されたブロックは、何度再接続をしても最初の一度だけしか呼び出されないが、
@akm
akm / check_permissions.rb
Created June 18, 2012 14:39
show files or directories which has different uid, gid or permission between current directory's ones
#!/usr/bin/env ruby
base_dir = File.expand_path(".")
base_stat = File.stat(base_dir)
base_dir_permission = base_stat.mode & 0o777
base_file_permission = (base_stat.mode ^ 0o111) & 0o777
f = lambda do |confirmation|
confirmation.puts "current directory: #{base_dir}"
confirmation.puts "base_dir_permission : %o" % base_dir_permission
インストールしたもの
Emacs-24.3-universal-10.6.8.dmg
GitX-L_v0.8.4.zip
googlechrome.dmg
GoogleJapaneseInput.dmg
Skype_6.8.60.351.dmg
xcode462_cltools_10_86938259a.dmg
xcode4630916281a.dmg
@akm
akm / file0.js
Created April 15, 2014 12:43
MongoDB-2.6.0で変わったensureIndexの振る舞い ref: http://qiita.com/akm/items/799f2c7a6a6697f25127
% mongo test
MongoDB shell version: 2.4.6
connecting to: test
>
> db.t1.drop();
false
> db.createCollection("t1", {});
{ "ok" : 1 }
> db.t1.ensureIndex({f1: 1}, {uniq: true});
> db.t1.ensureIndex({f1: 1}, {});
@akm
akm / file0.txt
Created April 16, 2014 05:05
MongoDB-2.6.0で変わったmongoexportの出力 ref: http://qiita.com/akm/items/528428dc5bc848a3963c
% mongo test --eval "db.d1.drop(); db.d1.insert({no: 1, d: new Date()})" && mongoexport -d test -c d1
MongoDB shell version: 2.4.6
connecting to: test
connected to: 127.0.0.1
{ "_id" : { "$oid" : "534e0af8532dbdbaa7c05783" }, "no" : 1, "d" : { "$date" : 1397623544193 } }
exported 1 records
@akm
akm / file0.txt
Last active September 20, 2018 12:11
ブラウザのURLをそのままコピペする方法 ref: https://qiita.com/akm/items/e11a17261f7e1056382a
http://ja.wikipedia.org/wiki/%E3%82%B3%E3%83%94%E3%83%BC%E3%83%BB%E3%82%A2%E3%83%B3%E3%83%89%E3%83%BB%E3%83%9A%E3%83%BC%E3%82%B9%E3%83%88