Skip to content

Instantly share code, notes, and snippets.

Takumi Kinjo kinjo

  • Japan
Block or report user

Report or block kinjo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View space-alc.rb
# -*- coding: utf-8 -*-
#!/usr/bin/env ruby
# GET english examples from SpaceAlc
require 'uri'
require 'open-uri'
require 'rubygems'
require 'nokogiri'
View e2j.rb
def e2j(eng)
eng.downcase.gsub("east", "").gsub("north", "").gsub("south", "").gsub("west", "西").gsub("e", "").gsub("n", "").gsub("s", "").gsub("w", "西")
end
View .emacs.org-insert-heading-categories-all.el
;; http://article.gmane.org/gmane.emacs.orgmode/10256
(defun org-get-heading-title ()
"Returns the heading of the current entry as a string, without the leading stars, the TODO keyword or the tags."
(let ((title-with-props (org-get-heading t))
(keyword (org-get-todo-state)))
(substring-no-properties title-with-props (if keyword (1+ (length keyword))))))
(defun org-insert-heading-category ()
"Insert a :CATEGORY: property and it's value to the PROPERTY drawer at point."
(interactive)
View .emacs.untabify-buffer.el
(defun untabify-buffer ()
(interactive)
(untabify 1 (point-max))
(if (not (eq major-mode 'mew-draft-mode))
;; delete-trailing-whitespace does not work in mew-draft-mode.
(delete-trailing-whitespace)))
View .emacs.errhdlr.el
(defmacro errhdlr (&rest body)
"do body in condition-case"
(declare (indent 0) (debug t))
(list 'condition-case 'err (cons 'progn body)
(list 'error
(list 'message "%s"
(list 'error-message-string 'err)))
(list 'file-error
(list 'message "%s"
(list 'error-message-string 'err)))))
View delete-file-kill-buffer.el
(defun delete-file-kill-buffer ()
"Do delete-file function then kill-buffer function"
(interactive)
(let ((buf (current-buffer))
(filepath (buffer-file-name (current-buffer))))
(when (and
(not (null filepath))
(file-exists-p filepath))
(delete-file filepath))
(kill-buffer buf)))
View hago100723.org

第 15 回社内勉強会(2010/07/23)

前回の復習

  • dev_appserver foo でアプリ起動 localhost:8080 でアクセス可能
@kinjo
kinjo / .gitignore
Created Aug 5, 2010
HTML5 Presentation export for Org-mode
View .gitignore
README.html
View hago18.org

HAGO#18 プログラムはどこまでやれば完成なのか (2010/08/27)

冒頭:根保さんから

  • http://mitsuhide.github.com/program/
  • ハッカーと画家から
    • ハッカーも画家も美しいものを作ろうとする
    • 「プログラムはどこまでやれば完成なのか?」
    • 「自分が納得いくまでやればいい!」
@kinjo
kinjo / generate-rss-xml.sh
Created Oct 30, 2010
Gather hash-tagged Twitter tweets and save them as a yaml file.
View generate-rss-xml.sh
#!/bin/bash
# needs ruby-1.9.2.
for i in `ls *.yml`; do
j=${i%.yml}
cat <<EOF > $j.xml
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet href="rdf.xsl" type="text/xsl"?>
<rdf:RDF xmlns="http://purl.org/rss/1.0/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
You can’t perform that action at this time.