Skip to content

Instantly share code, notes, and snippets.

Avatar
🦍

Yoshiyuki MIYAGI yosshi

🦍
View GitHub Profile
@yosshi
yosshi / file0.txt
Last active Dec 18, 2015
Emacs で半角カタカナを全角カタカナに置換したい ref: http://qiita.com/yosshi1202/items/651b0d410d3605cf030c
View file0.txt
M-x japanese-hankaku-region
M-x japanese-zenkaku-region
@yosshi
yosshi / garoon-emphasize.user-script.js
Created Apr 11, 2013
ガルーンの特定の文字列が含まれているタグ(a タグ等)を強調するためのユーザースクリプト 例: aタグ内の"メンテナンス"という文字列があるかどうか判定して強調する
View garoon-emphasize.user-script.js
// ==UserScript==
// @name garoon emphasize
// @namespace https://github.com/yosshi/garoon-emphasize
// @description garoon に表示されている文字を強調するためのスクリプト
// @include // garoon の URL
// @exclude
// ==/UserScript==
(function() {
@yosshi
yosshi / gist:5002131
Last active Dec 14, 2015
改行コードを dos2unix コマンドと find コマンドを使って一括置換
View gist:5002131

dos2unix をインストール(Mac)

brew install dos2unix

find コマンドで置換

find ./* -name "*.rb" -exec dos2unix {} ;

@yosshi
yosshi / gist:4104729
Created Nov 18, 2012
はじめてのHadoop 円周率を計算 Estimated value of Pi is 3.14150400000000000000
View gist:4104729
% hadoop jar /usr/local/Cellar/hadoop/1.0.4/libexec/hadoop-examples-1.0.4.jar pi 10 200000
Number of Maps = 10
Samples per Map = 200000
12/11/18 20:43:33 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Wrote input for Map #0
Wrote input for Map #1
Wrote input for Map #2
Wrote input for Map #3
Wrote input for Map #4
Wrote input for Map #5
@yosshi
yosshi / id333903271.html
Created Oct 3, 2012
Mobile Safari で mobile.twitter.com にアクセスすると、アプリのリンクが出る。そのソースコード
View id333903271.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="keywords" content="iTunes Store" /><meta name="description" content="iTunes Store" /><meta name="viewport" content="width = device-width, initial-scale = 1, minimum-scale = 1, maximum-scale = 1, user-scalable = no" /><meta name="platform-cache-id" content="16" />
<title></title>
@yosshi
yosshi / ffmpeg_baisoku.sh
Created Jun 5, 2012
ffmepg で X倍速再生動画を作成剃る方法。とりあえず3倍速
View ffmpeg_baisoku.sh
!#/bin/sh
ffmpeg -i IMGP8692.AVI -s 1280x720 -r 10.1 hoge.yuv
ffmpeg -s 1280x720 -r 29.97 -i hoge.yuv hoge.mp4
@yosshi
yosshi / gist:1185237
Created Sep 1, 2011
Emacs 24 for OSX Lion install 手順
View gist:1185237
# 後で整理する
git pull
./autogen.sh
./configure --with-ns --without-x
make
make install
cp -r ./nextstep/Emacs.app /Applications/Emacs24.app
@yosshi
yosshi / chrome
Created Aug 19, 2011
User-agent を指定してGoogle Chromeを起動するシェルスクリプト(mac)
View chrome
#!/bin/bash
# user agent
IPHONE='Mozilla/5.0 (iPhone Simulator; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7'
XPERIA="Mozilla/5.0 (Linux; U; Android 1.6; ja-jp; SonyEricssonSO-01B Build/R1EA018) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1"
IS04="Mozilla/5.0 (Linux; U; Android 2.1-update1; ja-jp; IS04 Build/FEK100) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17"
ANDROID=$IS04
EZWEB="KDDI-XX99 UP.Browser/6.2_7.2.7.1.K.8.400 (GUI) MMP/2.0"
GALAXY="Mozilla/5.0 (Linux; U; Android 2.3.3; ja-jp; SC-02B Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
@yosshi
yosshi / twitter_reverse_post.rb
Created Oct 19, 2010
コマンドラインで入力された文字を単純に逆さにして送信。
View twitter_reverse_post.rb
$KCODE='u'
require 'rubygems'
require 'twitter'
chars = ARGV[0].scan(/./)
TWITTER_USER=''
TWITTER_PASS=''
status = chars.reverse.join