- Hubot であそぼう
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
require 'spreadsheet' | |
require 'json' | |
Spreadsheet.client_encoding = 'UTF-8' | |
begin | |
book = Spreadsheet.open $*[0] | |
rescue | |
STDERR.puts "usage: ruby x2j.rb excel_file" | |
exit false |
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
# 関数定義 | |
func = function(hoge){ | |
return(hoge*hoge) | |
} | |
# 1から10までの整数のベクトルに対して関数を適用したい | |
x = 1:10 | |
# 絶対殺す | |
fx = as.numeric() |
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
.flat-table { | |
display: block; | |
font-family: sans-serif; | |
-webkit-font-smoothing: antialiased; | |
font-size: 115%; | |
overflow: auto; | |
width: auto; | |
th { | |
background-color: rgb(112, 196, 105); |
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 | |
# encoding: utf-8 | |
=begin | |
github_toc v0.2.0 | |
Brett Terpstra 2014 | |
<http://brettterpstra.com/2014/07/01/github-toc-service/> | |
Creates a linked table of contents from headers in a GitHub readme | |
Place a [toc] marker in the file to have it automatically replaced with the TOC |
- 🎨 when improving the format/structure of the code
- 🚀 when improving performance
- ✏️ when writing docs
- 💡 new idea
- 🚧 work in progress
- ➕ when adding feature
- ➖ when removing feature
- 🔈 when adding logging
- 🔇 when reducing logging
- 🐛 when fixing a bug
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
library('rgl'); library('magrittr') | |
cube <- function(x=0,y=0,z=0, bordered=TRUE, | |
filled = TRUE, lwd=2, scale=1, | |
fillcol = gray(.95), | |
bordercol ='black', ...) { | |
mycube <- cube3d() | |
# Reduce size to unit |
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
--- | |
title: "Get verbatim R chunks in R Markdown" | |
author: "Jenny Bryan" | |
date: "18 September, 2014" | |
output: | |
html_document: | |
keep_md: TRUE | |
--- | |
My periodic revisitation of "how can I include a verbatim R chunk in `.rmd`"? This time I am writing it down! Various proposed solutions: |
2017-08-03: Since I wrote this in 2014, the universe, specifically Kirill Müller (https://github.com/krlmlr), has provided better solutions to this problem. I now recommend that you use one of these two packages:
- rprojroot: This is the main package with functions to help you express paths in a way that will "just work" when developing interactively in an RStudio Project and when you render your file.
- here: A lightweight wrapper around rprojroot that anticipates the most likely scenario: you want to write paths relative to the top-level directory, defined as an RStudio project or Git repo. TRY THIS FIRST.
I love these packages so much I wrote an ode to here.
I use these packages now instead of what I describe below. I'll leave this gist up for historical interest. 😆