This file contains hidden or 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 -*- | |
| require 'rubygems' | |
| require 'twitter' | |
| require 'gdbm' | |
| require 'json' | |
| require 'tweetstream' | |
| # configure | |
| OAUTH_CONFIG = Proc.new do |config| | |
| config.consumer_key = "" |
This file contains hidden or 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
| // ==UserScript== | |
| // @name EvilRT | |
| // @namespace gyuque | |
| // @include https://plus.google.co* | |
| // ==/UserScript== | |
| (function() { | |
| function makeFunc(postBox) { | |
| var btn = document.createElement("button"); | |
| btn.innerHTML = "Blur"; |
This file contains hidden or 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
| module ChaosCall | |
| def method_missing(nua, *args) | |
| __send__((methods.select{|m| self.method(m).parameters.size == args.size}.sample), *args) | |
| end | |
| end | |
| list = [1,2,3,4] | |
| list.instance_eval{ | |
| extend ChaosCall |
This file contains hidden or 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 | |
| require 'MeCab' | |
| # TODO: 「いる・する」に対応する (動いている、録画する) | |
| # TODO: 助動詞の「だ・た」とかへの接続が不自然なので対応する | |
| # TODO: ipadic を使う | |
| CONJUGATIONS = [ | |
| %w[未然ウ接続 未然形 連用タ接続 連用形 基本形 連体形 仮定形 命令形] , | |
| %w(抱こ 抱か 抱い 抱き 抱く 抱く 抱け 抱け) , |
This file contains hidden or 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 -*- | |
| require 'rubygems' | |
| require 'RMagick' | |
| filename = ARGV.first | |
| unless filename | |
| warn "usage: #{$0} <ANIMATION GIF FILE>" | |
| exit 1 | |
| end |
This file contains hidden or 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
| import Control.Applicative hiding ( (<|>) ) | |
| import Text.Parsec | |
| -- parse like ruby's String.strip | |
| escSpace parser = spaces *> parser <* spaces | |
| -- parse like "between" in Text.Parsec | |
| close opener parser closer = char opener *> escSpace parser <* char closer | |
| -- Example |
This file contains hidden or 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
| スパルタンVim(以下、本書)は最近はあまり見かけなくなった質実剛健(スパルタン)な | |
| Vimユーザを目指す読者を対象に書かれています。本書はVimどころかコンピュータを利 | |
| 用する際に、一切の甘え、妥協を許しません。Vimを含めツールの過度な機能に頼った | |
| り、CPUの速度や潤沢なメモリに甘えたりすることは禁忌としています。そう、コン | |
| ピュータ利用の際に隠蔽されているあらゆる詳細を意識することを強要します。 | |
| 本書が目指すのはVimを使うことを通じてユーザの革新、ユーザ自身が持つハードウェア | |
| (脳を含めた肉体)の最適化です。いわばニュータイプです。「ツールが人間に合わせ | |
| る」など愚の骨頂、「人間がツールに極限まで適応する」のです。なぜならば人間が合 | |
| わせたほうが速いから。ツールが人間に合わせるには修正のために少なからず時間がか |
This file contains hidden or 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 | |
| puts ARGF.read.split(//).sort.join('') |
This file contains hidden or 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
| source "http://rubygems.org" | |
| gem "janky", "~>0.9" | |
| gem "pg" | |
| gem "thin" |
This file contains hidden or 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 -*- | |
| clippings = 'My Clippings.txt' | |
| ankiFile = 'AnkiImport.txt' | |
| def kindle_to_anki(): | |
| try: | |
| clippingsFile = open(clippings, 'r') | |
| except IOError, e: | |
| print '*** file open error: ', e |