Skip to content

Instantly share code, notes, and snippets.

View tototoshi's full-sized avatar

Toshiyuki Takahashi tototoshi

View GitHub Profile
import java.util.List
import twitter4j.Query
import twitter4j.QueryResult
import twitter4j.Tweet
import twitter4j.Twitter
import twitter4j.TwitterFactory
import scala.collection.JavaConversions._
object SimpleTwitterSearchApp {
def search(word: String = "#rpscala") {
(ns sample
(:import (twitter4j Query
QueryResult
Tweet
Twitter
TwitterFactory)))
(def twitter-api (.. (TwitterFactory.) getInstance))
(defn make-query [word]
import scala.collection.JavaConversions._
import java.util.List
import twitter4j.{TwitterFactory, Twitter, Tweet, QueryResult, Query}
object SimpleTwitterSearchApp {
def search(word: String = "#rpscala"): List[Tweet] = {
val query = new Query
query.setQuery(word)
val twitter = new TwitterFactory().getInstance()
#!/bin/bash
# edit
exec emacsclient -nw --alternate-editor="" -c "$@"
@tototoshi
tototoshi / gist:648421
Created October 27, 2010 04:13
my-flymake-config.el
;;;;;;;;;;;;;
;; flymake ;;
;;;;;;;;;;;;;
;; Flymake PHP Extension
(require 'flymake)
;; flymake
(when (require 'flymake nil t)
(global-set-key "\C-cd" 'flymake-display-err-menu-for-current-line)
;; PHP
@tototoshi
tototoshi / gist:648425
Created October 27, 2010 04:16
dired-config.el
;;;;;;;;;;;;;;;;;;;;;;;;;
;; dired configuration ;;
;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'wdired)
(require 'dired)
(add-hook 'dired-mode-hook
'(lambda ()
(define-key dired-mode-map [tab] 'dired-hide-subdir)
(define-key dired-mode-map "r" 'wdired-change-to-wdired-mode)
@tototoshi
tototoshi / gist:651543
Created October 28, 2010 15:10
gtags-config.el
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; GNU GLOBAL(gtags)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(autoload 'gtags-mode "gtags" "" t)
(setq gtags-mode-hook
'(lambda ()
(local-set-key "\M-t" 'gtags-find-tag)
(local-set-key "\M-r" 'gtags-find-rtag)
(local-set-key "\M-s" 'gtags-find-symbol)
(local-set-key "\C-t" 'gtags-pop-stack)
@tototoshi
tototoshi / gist:653992
Created October 29, 2010 17:52
scala-mode-config.el
;;;;;;;;;;;
;; scala ;;
;;;;;;;;;;;
(setq load-path (cons "~/.emacs.d/scala-mode" load-path))
(require 'scala-mode-auto)
(add-hook 'scala-mode-hook
(lambda ()
(scala-electric-mode)
(setq imenu-generic-expression
@tototoshi
tototoshi / gist:653993
Created October 29, 2010 17:52
scala-mode-config.el
;;;;;;;;;;;
;; scala ;;
;;;;;;;;;;;
(setq load-path (cons "~/.emacs.d/scala-mode" load-path))
(require 'scala-mode-auto)
(add-hook 'scala-mode-hook
(lambda ()
(scala-electric-mode)
(setq imenu-generic-expression
@tototoshi
tototoshi / gist:658254
Created November 1, 2010 14:33
.ctags
--langdef=scala
--langmap=scala:.scala
--regex-scala=/^[ \t]*class[ \t]+([a-zA-Z0-9_]+)/\1/c,classes/
--regex-scala=/^[ \t]*trait[ \t]+([a-zA-Z0-9_]+)/\1/t,traits/
--regex-scala=/^[ \t]*type[ \t]+([a-zA-Z0-9_]+)/\1/T,types/
--regex-scala=/^[ \t]*def[ \t]+([a-zA-Z0-9_]+)/\1/m,methods/
--regex-scala=/^[ \t]*val[ \t]+([a-zA-Z0-9_]+)/\1/C,constants/
--regex-scala=/^[ \t]*var[ \t]+([a-zA-Z0-9_]+)/\1/l,local variables/
--regex-scala=/^[ \t]*package[ \t]+([a-zA-Z0-9_.]+)/\1/p,packages/
--regex-scala=/^[ \t]*case class[ \t]+([a-zA-Z0-9_]+)/\1/c,case classes/