This file contains 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
library(stringr) | |
# 出入金レコード | |
b <- read.csv('bank statement.csv', fileEncoding='cp932') | |
b$date <- paste0(b$取扱日付.年,'/',b$取扱日付.月,'/',b$取扱日付.日) | |
b$amount <- ifelse(b$取引名 == '入金', b$金額, -b$金額) | |
b$detail <- ifelse(str_detect(b$摘要, 'VISA'), str_sub(b$摘要, 11, 16), as.character(b$摘要)) | |
b$payee <- ifelse(str_detect(b$摘要, 'VISA'), '', as.character(b$摘要)) | |
# b[,22:25] |
This file contains 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
library(gtable) | |
require(gtable) | |
library(foreach) | |
require(foreach) | |
unit.def <- 'inches' | |
plot.length.def <- 6 | |
legend.length.def <- 1.5 | |
as.unit <- function(n){return(unit(n, unit.def))} |
This file contains 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
library(ggplot2) | |
require(ggplot2) | |
# also require ggplot_lm.R on https://gist.github.com/shenqi/29b42a6be83ec9e0517d | |
ggplot0 <- function(x, y, data, label, shape, ...){ | |
return(ggplot(data, aes_string(x = x, y = y, label = label, shape = shape, ...))) | |
} | |
draw_ggplot <- function(x, y, data, point.size, label, label.hjust, shape, shape.solid, lm_formula, r2.adjusted, r2.pos_x, r2.pos_y, r2.digits, r2.color, legend.position, ...) { | |
g0 <- ggplot0(x, y, data, label, shape, ...) + geom_point(size = I(point.size)) + theme_classic() |
This file contains 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
library(ggplot2) | |
require(ggplot2) | |
# usage | |
# | |
# stat_r2(lm_obj, x, y, adjusted = FALSE, digits=NULL, ...) | |
# lm_obj lm object given by lm() | |
# x, y positional coordinate of r2 value | |
# adjusted use adjusted R2 instead | |
# digits see format() |
This file contains 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 zsh | |
if ! test -e /Applications/Xcode.app/; then | |
echo -e "\e[33;1mNeeds Xcode installed. Aborting...\e[m"; | |
open 'macappstore://itunes.apple.com/jp/app/xcode/id497799835?mt=12' && exit 1 | |
fi | |
function check_n_install(){ | |
local com2 com3 | |
if ! test -x $(/usr/bin/which $1); then | |
echo -e "\e[36mInstalling $1...\e[m" |
This file contains 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
This file contains any messages produced by compilers while | |
running configure, to aid debugging if configure makes a mistake. | |
It was created by configure, which was | |
generated by GNU Autoconf 2.57. Invocation command line was | |
$ ./configure --prefix=/usr/local/Cellar/screen/4.00.03 --mandir=/usr/local/Cellar/screen/4.00.03/share/man --infodir=/usr/local/Cellar/screen/4.00.03/share/info --enable-colors256 | |
## --------- ## | |
## Platform. ## |
This file contains 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
This file contains any messages produced by compilers while | |
running configure, to aid debugging if configure makes a mistake. | |
It was created by configure, which was | |
generated by GNU Autoconf 2.57. Invocation command line was | |
$ ./configure --prefix=/usr/local/Cellar/screen/4.00.03 --mandir=/usr/local/Cellar/screen/4.00.03/share/man --infodir=/usr/local/Cellar/screen/4.00.03/share/info --enable-colors256 | |
## --------- ## | |
## Platform. ## |
This file contains 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
/* | |
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ | |
* | |
* Uses the built in easing capabilities added In jQuery 1.1 | |
* to offer multiple easing options | |
* | |
* TERMS OF USE - jQuery Easing | |
* | |
* Open source under the BSD License. | |
* |
This file contains 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
<!DOCTYPE HTML> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>tarorow-shenqi.com</title> | |
<!--[if lt IE 9]> | |
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> | |
<![endif]--> | |
<link rel="stylesheet" href="http://yui.yahooapis.com/3.5.0/build/cssreset/cssreset-min.css" /> |
This file contains 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
function exif_film_lx(){ | |
foreach _file ($@) | |
echo 'Processing '${_file} | |
local _date | |
_date="$(exiftool -s3 -IPTC:DateCreated ${_file}) 00:00:00" | |
exiftool -q -overwrite_original -Make='Pentax' -Model='LX' -XMP-photoshop:DateCreated=${_date} - | |
IPTC:TimeCreated='00:00:00+00:00' -Exif:DateTimeOriginal=${_date} ${_file} | |
end | |
growlnotify -s -a /Applications/iTerm.app "iTerm" -m "Finished rewriting tags" | |
} |
NewerOlder