# at server
$ pwd
/home/YOURNAME
$ ruby create_empty_bare_repository.rb
Initialized empty Git repository in /home/YOURNAME/cixawa-20170509100453.git/
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
/* | |
* RemoteFollowBookmarklet.js | |
* | |
* When you see | |
* https://mastodon.example.com/@exampleuser | |
* or | |
* https://mastodon.example.com/users/exampleuser/... | |
* Then you jump to | |
* https://mastodon.example.com/users/exampleuser/remote_follow | |
*/ |
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
source "https://rubygems.org" | |
gem "mastodon-api" | |
gem "highline" | |
gem "oauth2" | |
gem "dotenv" |
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 ruby | |
require 'prime' | |
s = "31415926535" | |
s.length.times do |k| | |
t = s[0..k].to_i | |
if t.prime? | |
puts "#{t} is prime." |
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(){ | |
var current = 1; | |
function drawit(n) { | |
var ctx = $('#canvas')[0].getContext('2d'); | |
var size = 5; | |
var screen = 500; | |
var cols = screen / size; | |
for (var y = 0; y < cols; y++) { |
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
# 九九の表と倍数 | |
# https://twitter.com/hyuki/status/848895521846468608 | |
count = [] | |
(1..81).each do |n| | |
puts "n = #{n}" | |
count[n] = 0 | |
(1..9).each do |y| | |
(1..9).each do |x| | |
if x * y % n == 0 |
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
Phi = (Math.sqrt(5) + 1) / 2 | |
30.times do |n| | |
r = Phi ** n | |
puts r - r.to_i | |
end |
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
" vimgrep given pattern in predefined directories. | |
function LaTeXGrep(pattern) | |
execute 'vimgrep' a:pattern '$DOCGIRL/note/doc*/*.tex' '$DOCGIRL/doc*/*.tex' | |
copen | |
endfunction | |
command -nargs=1 LaTeXGrep call LaTeXGrep(<f-args>) |